mlos_core.optimizers.bayesian_optimizers.bayesian_optimizer module

Contains the wrapper classes for base Bayesian optimizers.

class mlos_core.optimizers.bayesian_optimizers.bayesian_optimizer.BaseBayesianOptimizer(*, parameter_space: ConfigurationSpace, optimization_targets: List[str], objective_weights: List[float] | None = None, space_adapter: BaseSpaceAdapter | None = None)

Bases: BaseOptimizer

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).

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.