bayes_opt.acquisition.ProbabilityOfImprovement

class bayes_opt.acquisition.ProbabilityOfImprovement(xi, exploration_decay=None, exploration_decay_delay=None, random_state=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, positive) – Governs the exploration/exploitation tradeoff. Lower prefers exploitation, higher prefers exploration.

  • exploration_decay (float, default None) – Decay rate for xi. 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, default None) – Set the random state for reproducibility.

base_acq(mean, std)

Calculate the probability of improvement.

Parameters:
  • mean (np.ndarray) – Mean of the predictive distribution.

  • std (np.ndarray) – Standard deviation of the predictive distribution.

Return type:

NDArray[Float]

Returns:

np.ndarray – Acquisition function value.

Raises:

ValueError – If y_max is not set.

decay_exploration()

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

suggest(gp, target_space, n_random=10000, n_l_bfgs_b=10, fit_gp=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.

Return type:

NDArray[Float]

Returns:

np.ndarray – Suggested point to probe next.