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
andExpectedImprovement
) 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: int | RandomState | None =
None
) None ¶ Base class for acquisition functions.
- Parameters:¶
- abstract base_acq(*args: Any, **kwargs: Any) ndarray[tuple[int, ...], dtype[floating[Any]]] ¶
Provide access to the base acquisition function.
-
suggest(gp: GaussianProcessRegressor, target_space: TargetSpace, n_random: int =
10000
, n_smart: int =10
, fit_gp: bool =True
, random_state: int | RandomState | None =None
) ndarray[tuple[int, ...], 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_smart : int, default 10¶
Controls the number of runs for the smart optimization. If all parameters are continuous, this is the number of random starting points for the L-BFGS-B optimizer. If there are discrete parameters, n_smart of the best points are used as starting points for the differential evolution optimizer, with the remaining points being random samples.
- fit_gp : bool, default True¶
Whether to fit the Gaussian Process to the target space. Set to False if the GP is already fitted.
- random_state : int, RandomState, default None¶
Random state to use for the optimization.
- Return type:¶
- Returns:¶
np.ndarray – Suggested point to probe next.