saealib.ExpectedImprovement

class saealib.ExpectedImprovement(xi=0.01, obj_idx=0, reference=None)[source]

Bases: AcquisitionFunction

Expected Improvement (EI) acquisition function.

EI balances exploration and exploitation by computing the expected amount of improvement over the current best observed value.

For single-objective minimization:

EI(x) = E[max(f_best - f(x), 0)]
       = (f_best - mu) * Phi(Z) + sigma * phi(Z)
where Z = (f_best - mu) / sigma

Requires a surrogate that provides uncertainty estimates (std).

Parameters:
  • xi (float) – Exploration-exploitation trade-off parameter. Higher values encourage more exploration. Default: 0.01.

  • obj_idx (int) – Index of the objective to optimize. Used for multi-objective problems where EI is applied to a single objective. Default: 0.

  • reference (Any)

Methods

__init__

compute_reference

Return fixed reference if set, otherwise component-wise best from archive.

score

Compute Expected Improvement scores.

Method Details

ExpectedImprovement.__init__(xi=0.01, obj_idx=0, reference=None)[source]
Parameters:
  • xi (float)

  • obj_idx (int)

  • reference (Any)

ExpectedImprovement.compute_reference(archive)[source]

Return fixed reference if set, otherwise component-wise best from archive.

Parameters:

archive (Archive)

Return type:

np.ndarray

ExpectedImprovement.score(prediction, reference)[source]

Compute Expected Improvement scores.

Parameters:
  • prediction (SurrogatePrediction) – Surrogate predictions. Must have std (has_uncertainty == True).

  • reference (Any) – Current best objective value. Scalar or ndarray of shape (n_obj,). The objective at index obj_idx is used.

Returns:

EI scores. shape: (n_samples,). Higher is better.

Return type:

np.ndarray

Raises:

TypeError – If prediction does not contain uncertainty estimates.