mlos_core.optimizers.random_optimizer
RandomOptimizer class.
Classes
Optimizer class that produces random suggestions. |
Module Contents
- class mlos_core.optimizers.random_optimizer.RandomOptimizer(*, parameter_space: ConfigSpace.ConfigurationSpace, optimization_targets: List[str], objective_weights: List[float] | None = None, space_adapter: mlos_core.spaces.adapters.adapter.BaseSpaceAdapter | None = None)[source]
Bases:
mlos_core.optimizers.optimizer.BaseOptimizer
Optimizer class that produces random suggestions.
Useful for baseline comparison against Bayesian optimizers.
Create a new instance of the base optimizer.
- Parameters:
parameter_space (ConfigSpace.ConfigurationSpace) – The parameter space to optimize.
optimization_targets (List[str]) – The names of the optimization targets to minimize. To maximize a target, use the negative of the target when registering scores.
objective_weights (Optional[List[float]]) – Optional list of weights of optimization targets.
space_adapter (BaseSpaceAdapter) – The space adapter class to employ for parameter space transformations.
- abstract register_pending(pending: mlos_core.data_classes.Suggestion) None [source]
Registers the given suggestion as “pending”. That is it say, it has been suggested by the optimizer, and an experiment trial has been started. This can be useful for executing multiple trials in parallel, retry logic, etc.
- Parameters:
pending (Suggestion) – The pending suggestion to register.
- Return type:
None