RandomizedSearch¶
- class mastml.hyper_opt.RandomizedSearch(param_names, param_values, scoring=None, n_iter=50, n_jobs=1)[source]¶
Bases:
HyperOptUtils
Class to conduct a randomized search to find optimized model hyperparameter values
- Args:
param_names: (list), list containing names of hyperparams to optimize
param_values: (list), list containing values of hyperparams to optimize
scoring: (str), string denoting name of regression metric to evaluate learning curves. See mastml.metrics.Metrics._metric_zoo for full list
n_iter: (int), number denoting the number of evaluations in the search space to perform. Higher numbers will take longer but will be more accurate
n_jobs: (int), number of jobs to run in parallel. Can speed up calculation when using multiple cores
- Methods:
- fitoptimizes hyperparameters
- Args:
X: (pd.DataFrame), dataframe of X feature data
y: (pd.Series), series of target y data
model: (mastml.models object), a MAST-ML model, e.g. SklearnModel or EnsembleModel
cv: (scikit-learn cross-validation object), a scikit-learn cross-validation object
savepath: (str), path of output directory
- Returns:
best_estimator (mastml.models object) : the optimized MAST-ML model
Methods Summary
fit
(X, y, model[, cv, savepath, refit])Methods Documentation