saealib.MeanPrediction#
- class saealib.MeanPrediction(weights=None, reference=None, direction=None)[source]#
Bases:
PointwiseAcquisitionAcquisition function based on predicted mean value (exploitation).
For single-objective problems, returns the predicted mean directly. For multi-objective problems, returns a weighted scalarization of the predicted mean.
A higher score indicates a more promising candidate. The sign convention follows the weight: use a negative weight for minimization (e.g., weights=np.array([-1.0])) so that lower objective values yield higher scores.
- Parameters:
weights (np.ndarray or None) – Weights for magnitude-aware scalarization of multi-objective predictions. shape: (n_obj,). If None and direction is also None, uses the first objective only.
direction (np.ndarray or None) – Per-objective optimization directions (+1 = maximize, -1 = minimize). Used for direction-only scalarization when magnitude does not matter. Takes precedence over weights when both are provided. When unset, it is auto-injected from
problem.directionat run start.reference (Any)
Methods
Return fixed reference if set, otherwise None. |
|
Return the pointwise acquisition contract. |
|
Reject |
|
Delegate to |
|
Compute scores based on predicted mean. |
Method Details
- MeanPrediction.__init__(weights=None, reference=None, direction=None)[source]#
- Parameters:
weights (ndarray | None)
reference (Any)
direction (ndarray | None)
- MeanPrediction.compute_reference(archive, rng=None)[source]#
Return fixed reference if set, otherwise None.
- Parameters:
archive (Archive)
rng (np.random.Generator | None)
- Return type:
Any
- MeanPrediction.contract()#
Return the pointwise acquisition contract.
- Return type:
- MeanPrediction.evaluate(candidates_x, prediction, archive, ctx=None, *, prepared=<object object>)#
Reject
prediction is None, resolve the reference, thenscore().See
AcquisitionFunction.evaluate()for the shared parameter contract, including the_UNSETvs. explicitprepared=Nonedistinction.- Parameters:
candidates_x (np.ndarray)
prediction (SurrogatePrediction | None)
archive (Archive)
ctx (OptimizationState | None)
prepared (Any)
- Return type:
AcquisitionResult
- MeanPrediction.prepare(archive, ctx=None)#
Delegate to
compute_reference(archive, rng=ctx.rng if ctx else None).- Parameters:
archive (Archive)
ctx (OptimizationState | None)
- Return type:
Any
- MeanPrediction.score(prediction, reference=None, rng=None)[source]#
Compute scores based on predicted mean.
- Parameters:
prediction (SurrogatePrediction) – Surrogate predictions. prediction.value shape: (n_samples, n_obj)
reference (Any) – Not used. Accepted for interface compatibility.
rng (Generator | None)
- Returns:
Scores. shape: (n_samples,)
- Return type:
np.ndarray