pipefitter.model_selection.HyperParameterTuning.gridsearch

HyperParameterTuning.gridsearch(table, n_jobs=None)

Fit model over various permutations of parameters

Parameters:

table : data set

The data set to use for training and scoring

n_jobs : int

The number of jobs to run in parallel (when supported by the backend)

Returns:

DataFrame

Notes

For small data sets when n_jobs > 1, the overhead of creating threads and multiple sessions on the backend may be greater than the time it takes to run each step sequentially.

Examples

Using a dict of parameter lists:

>>> hpt = HyperParameterTuning(estimator=estimator,
...                            param_grid = dict(
...                                max_depth=[6, 10],
...                                leaf_size=[3, 5]
...                            ))
>>> scores = hpt.gridsearch(data)

Using a list of parameter dictionaries:

>>> hpt = HyperParameterTuning(estimator=estimator,
...                            param_grid = [
...                                dict(max_depth=6, leaf_size=3),
...                                dict(max_depth=6, leaf_size=5),
...                                dict(max_depth=10, leaf_size=3),
...                                dict(max_depth=10, leaf_size=5),
...                            ])
>>> scores = hpt.gridsearch(data)