src.utils.tuning.hyper_grid_search
Classes
|
- class src.utils.tuning.hyper_grid_search.HyperGridSearch(**kwargs)
- Author:
Alberto M. Esmoris Pena
Class to apply grid search on the hyperparameter space of a model.
- Variables:
nthreads (int) – Number of threads to run parallel grid search nodes. Note that the model might have nthreads too. In this case, it is important that the number of threads from the grid search and the number of threads from the model itself are considered together.
num_folds (int) – Number of folds to train and validate the model on a kfolding scheme for each node in the grid search.
pre_dispatch (int or str) – How many jobs are dispatched during the parallel execution. It can be useful to prevent dispatching more jobs than those that can be processed by the CPUs.
grid (dict) – Dictionary which elements are lists. Each list in the dictionary represents the values that must be searched for the parameter referenced by the key.
- static extract_tuner_args(spec)
Extract the arguments to initialize/instantiate an HyperGridSearch from a key-word specification.
- Parameters:
spec – The key-word specification containing the arguments.
- Returns:
The arguments to initialize/instantiate an HyperGridSearch.
- __init__(**kwargs)
Initialize/instantiate an HyperGridSearch.
- Parameters:
kwargs – The attributes for the HyperGridSearch
- tune(model, pcloud=None)
Tune the given model with the best configuration found after computing a grid search on the model’s hyperparameters space. See
HyperTunerandTuner. Also, seetuner.Tuner.tune()- Parameters:
model – The model which hyperparameters must be tuned.
pcloud – The input point cloud (cannot be None).