saealib.LocalSurrogateManager

class saealib.LocalSurrogateManager(surrogate, acquisition, n_neighbors=50)[source]

Bases: SurrogateManager

Surrogate 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.

  • n_neighbors (int) – Number of nearest neighbors for local model training.

Methods

__init__

score_candidates

Fit a local model per candidate and score each individually.

Method Details

LocalSurrogateManager.__init__(surrogate, acquisition, n_neighbors=50)[source]
Parameters:
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]]