bayes_opt.acquisition

Acquisition functions for Bayesian Optimization.

The acquisition functions in this module can be grouped the following way:

  • One of the base acquisition functions (UpperConfidenceBound, ProbabilityOfImprovement and ExpectedImprovement) is always dictating the basic behavior of the suggestion step. They can be used alone or combined with a meta acquisition function.

  • GPHedge is a meta acquisition function that combines multiple base acquisition functions and determines the most suitable one for a particular problem.

  • ConstantLiar is a meta acquisition function that can be used for parallelized optimization and discourages sampling near a previously suggested, but not yet evaluated, point.

  • AcquisitionFunction is the base class for all acquisition functions. You can implement your own acquisition function by subclassing it. See the Acquisition Functions notebook to understand the many ways this class can be modified.

class bayes_opt.acquisition.AcquisitionFunction(random_state=None)

Base class for acquisition functions.

Parameters:
random_state : int, RandomState, default None

Set the random state for reproducibility.

abstract base_acq(*args, **kwargs)

Provide access to the base acquisition function.

suggest(gp: GaussianProcessRegressor, target_space: TargetSpace, n_random=10000, n_l_bfgs_b=10, fit_gp: bool = True)

Suggest a promising point to probe next.

Parameters:
gp : GaussianProcessRegressor

A fitted Gaussian Process.

target_space : TargetSpace

The target space to probe.

n_random : int, default 10_000

Number of random samples to use.

n_l_bfgs_b : int, default 10

Number of starting points for the L-BFGS-B optimizer.

fit_gp : bool, default True

Whether to fit the Gaussian Process to the target space. Set to False if the GP is already fitted.

Returns:

np.ndarray – Suggested point to probe next.