saealib.KNNObjectiveSet#

class saealib.KNNObjectiveSet(n_neighbors=50)[source]#

Bases: TrainingSet

Retrieve the k nearest archive neighbours of candidate_x.

This is the default training set for LocalSurrogateManager.

Parameters:

n_neighbors (int) – Number of nearest neighbours to retrieve.

Methods

__init__

build

Return k nearest-neighbour archive points around candidate_x.

contract

Return the training-set contract.

Method Details

KNNObjectiveSet.__init__(n_neighbors=50)[source]#
Parameters:

n_neighbors (int)

Return type:

None

KNNObjectiveSet.build(archive, population, ctx, candidate_x=None)[source]#

Return k nearest-neighbour archive points around candidate_x.

Parameters:
  • archive (Archive)

  • population (Population | None)

  • ctx (OptimizationState | None)

  • candidate_x (np.ndarray | None)

Return type:

TrainingData

KNNObjectiveSet.contract()#

Return the training-set contract.

Return type:

ComponentContract