saealib.LocalSurrogateManager¶
- class saealib.LocalSurrogateManager(surrogate, acquisition, training_set=None)[source]¶
Bases:
SurrogateManagerSurrogate manager that fits a local model per candidate (pre-selection).
For each candidate, retrieves the k nearest neighbors from the archive, fits the surrogate on that local neighborhood, and predicts the candidate’s objective value. This corresponds to the individual-based local modeling strategy (Guo et al., 2018).
NOTE: The same surrogate instance is reused across candidates (re-fit each iteration). This is not thread-safe. For parallel use, provide a surrogate factory instead (future work).
- Parameters:
surrogate (Surrogate) – Surrogate model instance (re-fit per candidate).
acquisition (AcquisitionFunction) – Acquisition function used to score predictions.
training_set (TrainingSet or None) – Strategy object for building training data per candidate. Defaults to
KNNObjectiveSet(n_neighbors=50), which preserves the previous behaviour.
Methods
Fit a local model per candidate and score each individually. |
Method Details
- LocalSurrogateManager.__init__(surrogate, acquisition, training_set=None)[source]¶
- Parameters:
surrogate (Surrogate)
acquisition (AcquisitionFunction)
training_set (TrainingSet | None)
- LocalSurrogateManager.score_candidates(candidates_x, archive, provider=None, ctx=None)[source]¶
Fit a local model per candidate and score each individually.
- Parameters:
candidates_x (np.ndarray)
archive (Archive)
provider (ComponentProvider | None)
ctx (OptimizationContext | None)
- Return type:
tuple[np.ndarray, list[SurrogatePrediction]]