mlos_core.optimizers.bayesian_optimizers
.BaseBayesianOptimizer¶
- class mlos_core.optimizers.bayesian_optimizers.BaseBayesianOptimizer(*, parameter_space: ConfigurationSpace, optimization_targets: List[str], objective_weights: List[float] | None = None, space_adapter: BaseSpaceAdapter | None = None)¶
Abstract base class defining the interface for Bayesian optimization.
- Attributes:
space_adapter
Get the space adapter instance (if any).
Methods
acquisition_function
(*, configs[, context])Invokes the acquisition function from this Bayesian optimizer for the given configuration.
cleanup
()Remove temp files, release resources, etc.
get_best_observations
(*[, n_max])Get the N best observations so far as a triplet of DataFrames (config, score, context).
get_observations
()Returns the observations as a triplet of DataFrames (config, score, context).
register
(*, configs, scores[, context, metadata])Wrapper method, which employs the space adapter (if any), before registering the configs and scores.
register_pending
(*, configs[, context, metadata])Registers the given configs as "pending".
suggest
(*[, context, defaults])Wrapper method, which employs the space adapter (if any), after suggesting a new configuration.
surrogate_predict
(*, configs[, context])Obtain a prediction from this Bayesian optimizer's surrogate model for the given configuration(s).
- __init__(*, parameter_space: ConfigurationSpace, optimization_targets: List[str], objective_weights: List[float] | None = None, space_adapter: BaseSpaceAdapter | None = None)¶
Create a new instance of the base optimizer.
- Parameters:
- parameter_spaceConfigSpace.ConfigurationSpace
The parameter space to optimize.
- optimization_targetsList[str]
The names of the optimization targets to minimize.
- objective_weightsOptional[List[float]]
Optional list of weights of optimization targets.
- space_adapterBaseSpaceAdapter
The space adapter class to employ for parameter space transformations.
- abstract acquisition_function(*, configs: DataFrame, context: DataFrame | None = None) ndarray[Any, dtype[_ScalarType_co]] ¶
Invokes the acquisition function from this Bayesian optimizer for the given configuration.
- Parameters:
- configspd.DataFrame
Dataframe of configs / parameters. The columns are parameter names and the rows are the configs.
- contextpd.DataFrame
Not Yet Implemented.
- abstract surrogate_predict(*, configs: DataFrame, context: DataFrame | None = None) ndarray[Any, dtype[_ScalarType_co]] ¶
Obtain a prediction from this Bayesian optimizer’s surrogate model for the given configuration(s).
- Parameters:
- configspd.DataFrame
Dataframe of configs / parameters. The columns are parameter names and the rows are the configs.
- contextpd.DataFrame
Not Yet Implemented.