Skip to content

Commit

Permalink
Now we can create plots!
Browse files Browse the repository at this point in the history
Tereso del Rio committed Sep 18, 2023
1 parent 94398cc commit ecbc7e6
Showing 25 changed files with 221 additions and 135 deletions.
12 changes: 12 additions & 0 deletions config/general_values.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@

purposes = ['Train', 'Test']
dataset_qualities = ['Normal', 'Balanced', 'Augmented']


def aveg(given_list):
return sum(given_list)/len(given_list)


def aveg_not_zero(given_list):
return sum(given_list)/max(1, len([1 for elem in given_list
if elem != 0]))


operations = [sum, max, aveg] # , aveg_not_zero
31 changes: 8 additions & 23 deletions config/hyperparameters_grid.py
Original file line number Diff line number Diff line change
@@ -2,16 +2,10 @@

grid = dict()
grid['RF'] = {
# 'n_estimators': [200, 300, 400, 500],
# 'max_features': ['sqrt', 'log2'],
# 'max_depth': [4, 5, 6, 7, 8],
# 'criterion': ['gini', 'entropy']
'n_estimators': [50, 100, 200],
'criterion': ['gini', 'entropy'],
'max_depth': [None, 10, 20, 30],
'min_samples_split': [2, 5, 10],
'min_samples_leaf': [1, 2, 4],
'class_weight': [None, 'balanced'],
'n_estimators': [200, 300, 400, 500],
'max_features': ['sqrt', 'log2'],
'max_depth': [4, 5, 6, 7, 8],
'criterion': ['gini', 'entropy']
}
grid['KNN'] = {
'n_neighbors': [1,3,5,7,12],
@@ -41,18 +35,9 @@
}

grid['RFR'] = {
# 'n_estimators': [200, 300, 400, 500],
# 'max_features': ['sqrt', 'log2'],
# 'max_depth': [4, 5, 6, 7, 8],
# 'criterion': ['squared_error', 'entropy']
# # 'criterion': ['squared_error', 'friedman_mse'],
# # "max_depth": [1,3,7],
# # "min_samples_leaf": [1,5,10],
'n_estimators': [50, 100, 200],
'criterion': ['mse', 'mae'],
'max_depth': [None, 10, 20, 30],
'min_samples_split': [2, 5, 10],
'min_samples_leaf': [1, 2, 4],
'criterion': ['squared_error', 'friedman_mse'],
"max_depth": [1,3,7],
"min_samples_leaf": [1,5,10],
}
grid['KNNR'] = {
'n_neighbors': [3, 5, 10],
@@ -82,4 +67,4 @@
grid['SGD'] = {
'loss':["squared_error", "huber", "epsilon_insensitive"],
'penalty':["l2", "l1", "elasticnet"]
}
}
4 changes: 2 additions & 2 deletions config/hyperparams/augmented_DT.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
criterion: gini
max_depth: 16
splitter: best
max_depth: 19
splitter: random
2 changes: 1 addition & 1 deletion config/hyperparams/augmented_KNN.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
algorithm: kd_tree
algorithm: auto
n_neighbors: 12
weights: distance
2 changes: 1 addition & 1 deletion config/hyperparams/balanced_DT.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
criterion: gini
max_depth: 7
max_depth: 4
splitter: best
2 changes: 1 addition & 1 deletion config/hyperparams/balanced_KNN.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
algorithm: auto
algorithm: ball_tree
n_neighbors: 1
weights: uniform
2 changes: 1 addition & 1 deletion config/hyperparams/normal_DT.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
criterion: gini
max_depth: 13
max_depth: 10
splitter: random
2 changes: 1 addition & 1 deletion config/hyperparams/normal_KNN.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
algorithm: auto
n_neighbors: 7
n_neighbors: 5
weights: distance
16 changes: 8 additions & 8 deletions config/ml_models.py
Original file line number Diff line number Diff line change
@@ -13,19 +13,19 @@
from sklearn.neighbors import KNeighborsRegressor

ml_models = [
# 'KNN',
# 'DT',
# 'SVC',
'KNN',
'DT',
'SVC',
'RF',
# 'MLP'
'MLP'
]

ml_regressors = [
# 'DTR',
# 'SVR',
'DTR',
'SVR',
'RFR',
# 'KNNR',
# 'MLPR'
'KNNR',
'MLPR'
]

sklearn_models = {
Loading

0 comments on commit ecbc7e6

Please sign in to comment.