Skip to content

Commit f272d7a

Browse files
committed
updated best parameters for grid search
1 parent 2a1bd63 commit f272d7a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

grid/best_classifiers.pickle

1.88 MB
Binary file not shown.

grid/best_regressors.pickle

71.5 KB
Binary file not shown.

grid_search.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
from emotion_recognition import EmotionRecognizer
1313
from parameters import classification_grid_parameters, regression_grid_parameters
1414

15+
# emotion classes you want to perform grid search on
1516
emotions = ['sad', 'neutral', 'happy']
17+
# number of parallel jobs during the grid search
18+
n_jobs = 4
1619

1720
best_estimators = []
1821

@@ -23,7 +26,7 @@
2326
params['n_neighbors'] = [len(emotions)]
2427
d = EmotionRecognizer(model, emotions=emotions)
2528
d.load_data()
26-
best_estimator, best_params, cv_best_score = d.grid_search(params=params)
29+
best_estimator, best_params, cv_best_score = d.grid_search(params=params, n_jobs=n_jobs)
2730
best_estimators.append((best_estimator, best_params, cv_best_score))
2831
print(f"{emotions} {best_estimator.__class__.__name__} achieved {cv_best_score:.3f} cross validation accuracy score!")
2932

@@ -39,7 +42,7 @@
3942
params['n_neighbors'] = [len(emotions)]
4043
d = EmotionRecognizer(model, emotions=emotions, classification=False)
4144
d.load_data()
42-
best_estimator, best_params, cv_best_score = d.grid_search(params=params)
45+
best_estimator, best_params, cv_best_score = d.grid_search(params=params, n_jobs=n_jobs)
4346
best_estimators.append((best_estimator, best_params, cv_best_score))
4447
print(f"{emotions} {best_estimator.__class__.__name__} achieved {cv_best_score:.3f} cross validation MAE score!")
4548

0 commit comments

Comments
 (0)