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,ProbabilityOfImprovementandExpectedImprovement) is always dictating the basic behavior of the suggestion step. They can be used alone or combined with a meta acquisition function.GPHedgeis a meta acquisition function that combines multiple base acquisition functions and determines the most suitable one for a particular problem.ConstantLiaris a meta acquisition function that can be used for parallelized optimization and discourages sampling near a previously suggested, but not yet evaluated, point.AcquisitionFunctionis 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: int | RandomState | None =
None) None¶ Base class for acquisition functions.
- Parameters:¶
- abstract base_acq(*args: Any, **kwargs: Any) ndarray[Any, dtype[floating[Any]]]¶
Provide access to the base acquisition function.
-
suggest(gp: GaussianProcessRegressor, target_space: TargetSpace, n_random: int =
10000, n_l_bfgs_b: int =10, fit_gp: bool =True) ndarray[Any, dtype[floating[Any]]]¶ 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.
- Return type:¶
- Returns:¶
np.ndarray – Suggested point to probe next.