bayes_opt.acquisition.UpperConfidenceBound¶
-
class bayes_opt.acquisition.UpperConfidenceBound(kappa: float =
2.576, exploration_decay: float | None =None, exploration_decay_delay: int | None =None, random_state: int | RandomState | None =None) None¶ Upper Confidence Bound acquisition function.
The upper confidence bound is calculated as
\[\text{UCB}(x) = \mu(x) + \kappa \sigma(x).\]- Parameters:¶
- kappa : float, default 2.576¶
Governs the exploration/exploitation tradeoff. Lower prefers exploitation, higher prefers exploration.
- exploration_decay : float, default None¶
Decay rate for kappa. If None, no decay is applied.
- exploration_decay_delay : int, default None¶
Delay for decay. If None, decay is applied from the start.
- random_state : int | RandomState | None¶
- base_acq(mean: ndarray[tuple[int, ...], dtype[floating[Any]]], std: ndarray[tuple[int, ...], dtype[floating[Any]]]) ndarray[tuple[int, ...], dtype[floating[Any]]]¶
Calculate the upper confidence bound.
- decay_exploration() None¶
Decay kappa by a constant rate.
Adjust exploration/exploitation trade-off by reducing kappa. :rtype:
NoneNote
This method is called automatically at the end of each
suggest()call.- Return type:¶
None
-
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¶
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.
- random_state : int, RandomState, default None¶
Random state to use for the optimization.
- Return type:¶
- Returns:¶
np.ndarray – Suggested point to probe next.