-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added orchestrator and template * class for parameter grids * Added entry points support for custom models with Pipeline Co-authored-by: gwarmstrong <[email protected]> * Adds ability to set_params of custom models (Pipelines) * Adds a _parameters.py containing defined parameter grids * parameter grids * parameter get * file locating bug fixed * added templates * template issues * orchestrator json fixes in template * Final Random Forest grids * more updates to parameter grid for RF * grid updates * randomized parameters, minor template tweak * Added template to setup * remove extra template * reduced param grids for rf * update to template and preprocess bugfix * Option for reduced parameter grid, where defined * option flags * (untested) adds force option, info txt * tested previous additions * Fixed result-skipping behavior, removed lgbm * checking for existing results fix * specify intel in resource list * Update q2_mlab/orchestrator.py Co-authored-by: Yoshiki Vázquez Baeza <[email protected]> Co-authored-by: gwarmstrong <[email protected]> Co-authored-by: Patrick McGrath <[email protected]> Co-authored-by: Patrick McGrath <[email protected]> Co-authored-by: Patrick McGrath <[email protected]> Co-authored-by: Yoshiki Vázquez Baeza <[email protected]>
- Loading branch information
1 parent
3f137e4
commit 808a6d0
Showing
8 changed files
with
442 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import numpy as np | ||
from sklearn.model_selection import ParameterGrid | ||
|
||
|
||
class ParameterGrids: | ||
def get(algorithm): | ||
grids = { | ||
"LinearSVC": { | ||
'penalty': ['l2'], | ||
'tol': [1e-4, 1e-3, 1e-2, 1e-1], | ||
'loss': ['hinge', 'squared_hinge'], | ||
'random_state': [2018] | ||
}, | ||
"LinearSVR": { | ||
"C": [1e-4, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e4], | ||
"epsilon": [1e-2, 1e-1, 0, 1], | ||
"loss": ["squared_epsilon_insensitive", "epsilon_insensitive"], | ||
"random_state": [2018], | ||
}, | ||
"RidgeClassifier": { | ||
"alpha": [1e-15, 1e-10, 1e-8, 1e-4], | ||
"fit_intercept": [True], | ||
"normalize": [True, False], | ||
"tol": [1e-1, 1e-2, 1e-3], | ||
"solver": [ | ||
"svd", | ||
"cholesky", | ||
"lsqr", | ||
"sparse_cg", | ||
"sag", | ||
"saga", | ||
], | ||
"random_state": [2018], | ||
}, | ||
"RidgeRegressor": { | ||
"alpha": [1e-15, 1e-10, 1e-8, 1e-4], | ||
"fit_intercept": [True], | ||
"normalize": [True, False], | ||
"tol": [1e-1, 1e-2, 1e-3], | ||
"solver": [ | ||
"svd", | ||
"cholesky", | ||
"lsqr", | ||
"sparse_cg", | ||
"sag", | ||
"saga", | ||
], | ||
"random_state": [2018], | ||
}, | ||
"RandomForestClassifier": { | ||
"n_estimators": [1000, 5000], | ||
"criterion": ["gini", "entropy"], | ||
"max_features": ["sqrt", "log2", None] + list(np.arange(0.2, 1, 0.2)), | ||
"max_samples": [0.25, 0.5, 0.75, None], | ||
"max_depth": [None], | ||
"n_jobs": [-1], | ||
"random_state": [2020], | ||
"bootstrap": [True], | ||
"min_samples_split": list(np.arange(0.2, 1, 0.2)) + [2], | ||
"min_samples_leaf": list(np.arange(0.01, 0.5, 0.2)) + [1], | ||
}, | ||
"RandomForestRegressor": { | ||
'n_estimators': [1000, 5000], | ||
'criterion': ['mse', 'mae'], | ||
"max_features": ["sqrt", "log2", None] + list(np.arange(0.2, 1, 0.2)), | ||
"max_samples": [0.25, 0.5, 0.75, None], | ||
'max_depth': [None], | ||
'n_jobs': [-1], | ||
'random_state': [2020], | ||
'bootstrap': [True], | ||
'min_samples_split': list(np.arange(0.2, 1, 0.2)) + [2], | ||
'min_samples_leaf': list(np.arange(0.01, .5, 0.2)) + [1], | ||
}, | ||
} | ||
return grids[algorithm] | ||
|
||
def get_reduced(algorithm): | ||
grids = { | ||
"RandomForestClassifier": { | ||
"n_estimators": [5000], | ||
"criterion": ["gini"], | ||
"max_features": ["sqrt", "log2", None] + list(np.arange(0.2, 1, 0.2)), | ||
"max_samples": [0.25, 0.5, 0.75, None], | ||
"max_depth": [None], | ||
"n_jobs": [-1], | ||
"random_state": [2020], | ||
"bootstrap": [True], | ||
}, | ||
"RandomForestRegressor": { | ||
'n_estimators': [5000], | ||
'criterion': ['mse'], | ||
"max_features": ["sqrt", "log2", None] + list(np.arange(0.2, 1, 0.2)), | ||
"max_samples": [0.25, 0.5, 0.75, None], | ||
'max_depth': [None], | ||
'n_jobs': [-1], | ||
'random_state': [2020], | ||
'bootstrap': [True], | ||
}, | ||
} | ||
return grids[algorithm] | ||
|
||
def get_size(algorithm): | ||
return len(list(ParameterGrid(ParameterGrids.get(algorithm)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.