Class: OMGSearchCV

OMGSearchCV(params)

Optimizes hyperparameters for supplied estimator. A very simple version of genetic algorithm is used for this otpimization. See more in optimization-js, in particular in OMGOptimizer docs.

Constructor

new OMGSearchCV(params)

Creates an instance of OMGSearchCV.
Parameters:
Name Type Description
params Object Parameters of the hyperparameter optimization algorithm.
Properties
Name Type Attributes Description
estimator BaseEstimator <optional>
Estimator instance, whose hyperparameters are optimized.
param_grid Object <optional>
Specification of the search space, over which to optimize the estimator parameters. The specification should be given in the following format: name_of_parameter: optimization-js dimension object instance Here dimension object should be one of Integer, Real or Categorical class instances from optimization-js package.
max_iter Number <optional>
Maximum number of iterations, allowed for the algorithm to execute. The algorithm could be terminated prematurely via callbacks.
cv Number <optional>
Number of cross validation folds that are used for evaluation of particular hyperparameter configuration.
refit_on_improvement Boolean <optional>
Whether to fit the final model on the whole dataset as soon as improvement in hyperparameter configuration is obtained, w.r.t. CV score.
refit Boolean <optional>
Whether to fit the final model after the hyperparameter search has concluded.
Source:

Methods

Clear the temporarily stored variables for the grid search.
Source:

(async) fit_final(X, y)

Fits the model with set best parameters to the data.
Parameters:
Name Type Description
X Array input samples
y Array output samples
Source:

get_dim_vector()

Gets the vector of dimensions that represent a search space flattened to vector.
Source:

(async) init()

Initialize the search algorithm.
Source:

(async) step() → {Object}

Run a single step of search algorithm.
Source:
Returns:
object that indicate result of a step. Parameters of the object are as follows: - {Boolean} improved whether there was an improvement in score.
Type
Object

update_ranges(values)

Updates the ranges of hyperparameters to search over. This is useful in case first the models with small complexity are intended to be tried. Then in few initial iterations, smaller parameters that control complexity should be given. Note: only the ranges should be updated for dimensions. Adding new dimensions will likely lead to unexpected behavior.
Parameters:
Name Type Description
values Object Dictionary with keys being names of the parameters, and values being dimensions of the optimization-js type.
Source: