mloptimizer.hyperparams.hyperparam#

Module Contents#

Classes#

Hyperparam

Class to define a hyperparam to optimize. It defines the name, min value, max value and type.

class mloptimizer.hyperparams.hyperparam.Hyperparam(name: str, min_value: int, max_value: int, hyperparam_type: str, scale: int = 100, values_str: list = None)[source]#

Bases: object

Class to define a hyperparam to optimize. It defines the name, min value, max value and type. This is used to control the precision of the hyperparam and avoid multiple evaluations with close values of the hyperparam due to decimal positions.

name#

Name of the hyperparam. It will be used as key in a dictionary

Type:

str

min_value#

Minimum value of the hyperparam

Type:

int

max_value#

Maximum value of the hyperparam

Type:

int

hyperparam_type#

Type of the hyperparam (‘int’, ‘float’, ‘nexp’, ‘x10’)

Type:

str

scale#

Optional param in case the type=float

Type:

int, optional (default=100)

values_str#

List of string with possible values (TODO)

Type:

list, optional (default=[])

correct(value: int)[source]#
Returns the real value of the hyperparam in case some mutation could surpass the limits.
  1. Verifies the input is int

  2. Enforce min and max value

  3. Apply the type of value

Parameters:

value (int) – Value to correct

Returns:

ret – Corrected value

Return type:

int, float