The physlearn.supervised.model_selection.search module provides
basic utilities for automated (hyper)parameter search.
Helper (hyper)parameter search function.
search_method (str) – Specifies the search method. If 'gridsearchcv', 'randomizedsearchcv',
or 'bayesoptcv' then the search method is GridSearchCV, RandomizedSearchCV,
or Bayesian Optimization.
pipeline (ModifiedPipeline) – A ModifiedPipeline object.
search_params (dict) – Dictionary with (hyper)parameter names as keys, and either lists of (hyper)parameter settings to try as values or tuples of (hyper)parameter lower and upper bounds to try as values.
scoring (str, callable, list/tuple, or dict, optional (default='neg_mean_absolute_error')) – Determines scoring in the k-fold cross-validation methods.
refit (bool, optional (default=True)) – Determines whether to return the refit ModifiedPipeline object.
n_jobs (int or None, optional (default=-1)) – The number of jobs to run in parallel in GridSearchCV and RandomizedSearchCV.
cv (int, cross-validation generator, an iterable, or None, optional (default=None)) – Determines the cross-validation strategy. If None, then the default is 5-fold cross-validation.
verbose (int, optional (default=0)) – Determines verbosity.
pre_dispatch (int or str, optional (default='2*n_jobs')) – Controls the number of jobs that get dispatched during parallel execution in GridSearchCV and RandomizedSearchCV.
error_score ('raise' or numeric, optional (default=np.nan)) – The assigned value if an error occurs while inducing a regressor. If set to ‘raise’, then the specific error is raised. Else if set to a numeric value, then FitFailedWarning is raised in GridSearchCV and RandomizedSearchCV.
return_train_score (bool or None, optional (default=None)) – Determines whether to return the training scores from the k-fold cross-validation methods in GridSearchCV and RandomizedSearchCV.
randomizedcv_n_iter (int or None, optional (default=None)) – Determines the number of (hyper)parameter settings that are sampled in RandomizedSearchCV.
X (array-like of shape = [n_samples, n_features] or None, optional (default=None)) – The design matrix, where each row corresponds to an example and the column(s) correspond to the feature(s). Used in Bayesian Optimization.
y (array-like of shape = [n_samples] or shape = [n_samples, n_targets] or None, optional (default=None)) – The target matrix, where each row corresponds to an example and the column(s) correspond to the single-target(s). Used in Bayesian Optimization.
random_state (int, RandomState instance, or None, optional (default=0)) – Determines the random number generation in Bayesian Optimization.
init_points (int or None, optional (default=None)) – Determines the number of random exploration steps in Bayesian Optimization. Increasing the number corresponds to diversifying the exploration space.
bayesoptcv_n_iter (int or None, optional (default=None)) – Determines the number of optimization steps in in Bayesian Optimization.