Hyperparam#
This class provides a way to define hyperparameters for a machine learning model.
- class mloptimizer.domain.hyperspace.Hyperparam(name: str, min_value: int, max_value: int, hyperparam_type: str, scale: int = 100, values_str: list = None)[source]#
Bases:
objectClass 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.
- values_str#
List of string with possible values. Used when the hyperparam_type=’list’
- Type:
list, optional (default=[])
Creates object Hyperparam.
- Parameters:
name (str) – Name of the hyperparam. It will be used as key in a dictionary
min_value (int) – Minimum value of the hyperparam
max_value (int) – Maximum value of the hyperparam
hyperparam_type (str) – Type of the hyperparam (‘int’, ‘float’, ‘nexp’, ‘x10’, ‘list’)
scale (int, optional (default=100)) – Optional param in case the hyperparam_type=’float’
values_str (list, optional (default=[])) – List of string with possible values. Used when the hyperparam_type=’list’
- correct(value: int)[source]#
- Returns the real value of the hyperparam in case some mutation could surpass the limits.
Verifies the input is int
Enforce min and max value
Apply the type of value