bayes_opt.acquisition.ProbabilityOfImprovement

class bayes_opt.acquisition.ProbabilityOfImprovement(xi: float, exploration_decay: float | None = None, exploration_decay_delay: int | None = None, random_state: int | RandomState | None = None) → None

Probability of Improvement acqusition function.

Calculated as

\[\text{POI}(x) = \Phi\left( \frac{\mu(x)-y_{\text{max}} - \xi }{\sigma(x)} \right)\]

where \(\Phi\) is the CDF of the normal distribution.

Parameters:
  • xi (float) – Governs the exploration/exploitation tradeoff. Lower prefers exploitation, higher prefers exploration.

  • exploration_decay (float | None) – Decay rate for xi. If None, no decay is applied.

  • exploration_decay_delay (int | None) – Delay for decay. If None, decay is applied from the start.

  • random_state (int | RandomState | None) – Set the random state for reproducibility.

base_acq(mean: ndarray[tuple[Any, ...], dtype[floating[Any]]], std: ndarray[tuple[Any, ...], dtype[floating[Any]]]) → ndarray[tuple[Any, ...], dtype[floating[Any]]]

Calculate the probability of improvement.

Parameters:
  • mean (ndarray[tuple[Any, ...], dtype[floating[Any]]]) – Mean of the predictive distribution.

  • std (ndarray[tuple[Any, ...], dtype[floating[Any]]]) – Standard deviation of the predictive distribution.

Return type:

ndarray[tuple[Any, ...], dtype[floating[Any]]]

Returns:

np.ndarray – Acquisition function value.

Raises:

ValueError – If y_max is not set.

decay_exploration() → None

Decay xi by a constant rate.

Adjust exploration/exploitation trade-off by reducing xi.

Note

This method is called automatically at the end of each suggest() call.

Return type:

None

get_acquisition_params() → dict[str, Any]

Get the current acquisition function parameters.

Return type:

dict[str, Any]

Returns:

dict – Dictionary containing the current acquisition function parameters.

set_acquisition_params(params: dict[str, Any]) → None

Set the acquisition function parameters.

Parameters:

params (dict[str, Any]) – Dictionary containing the acquisition function parameters.

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[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) – Number of random samples to use.

  • n_smart (int) – Number of starting points for the L-BFGS-B optimizer.

  • fit_gp (bool) – Whether to fit the Gaussian Process to the target space. Set to False if the GP is already fitted.

  • random_state (int | RandomState | None) – Random state to use for the optimization.

Return type:

ndarray[tuple[Any, ...], dtype[floating[Any]]]

Returns:

np.ndarray – Suggested point to probe next.