Space

class sklearn_genetic.space.Categorical(choices: Optional[list] = None, priors: Optional[list] = None, distribution: str = 'choice')[source]

class for hyperparameters search space of categorical values

Parameters
choices: list, default=None

List with all the possible values of the hyperparameter.

priors: int, default=None

List with the probability of sampling each element of the “choices”, if not set gives equals probability.

distribution: str, default=’choice’

Distribution to sample initial population and mutation values, currently only supports “choice”.

sample()[source]

Sample a random value from the assigned distribution

class sklearn_genetic.space.Continuous(lower: Optional[float] = None, upper: Optional[float] = None, distribution: str = 'uniform')[source]

class for hyperparameters search space of real values

Parameters
lowerint, default=None

Lower bound of the possible values of the hyperparameter.

upperint, default=None

Upper bound of the possible values of the hyperparameter.

distribution{‘uniform’, ‘log-uniform’}, default=’uniform’

Distribution to sample initial population and mutation values.

sample()[source]

Sample a random value from the assigned distribution

class sklearn_genetic.space.Integer(lower: Optional[int] = None, upper: Optional[int] = None, distribution: str = 'uniform')[source]

class for hyperparameters search space of integer values

Parameters
lowerint, default=None

Lower bound of the possible values of the hyperparameter.

upperint, default=None

Upper bound of the possible values of the hyperparameter.

distributionstr, default=”uniform”

Distribution to sample initial population and mutation values, currently only supports ‘uniform’.

sample()[source]

Sample a random value from the assigned distribution

class sklearn_genetic.space.Space(param_grid: Optional[dict] = None)[source]

Search space for all the models hyperparameters

Parameters
param_grid: dict, default=None

Grid with the parameters to tune, expects keys a valid name of hyperparameter based on the estimator selected and as values one of Integer , Categorical Continuous classes

property dimensions
Returns
The number of hyperparameters defined in the param_grid
property parameters
Returns
A list with all the names of the hyperparametes in the param_Grid