saealib.KNNConstraintObjectiveSet#

class saealib.KNNConstraintObjectiveSet(n_neighbors=50)[ソース]#

ベースクラス: TrainingSet

Retrieve the k nearest archive neighbours of candidate_x.

Analogue of KNNObjectiveSet for constraint surrogates. Returns the k-NN subset of (archive.x, archive.g) centred on candidate_x.

パラメータ:

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

例外:

ValueError -- If candidate_x is None, or if the archive has no constraint columns.

Methods

__init__

build

Return k nearest-neighbour archive points with raw constraint values.

contract

Return the training-set contract.

Method Details

KNNConstraintObjectiveSet.__init__(n_neighbors=50)[ソース]#
パラメータ:

n_neighbors (int)

戻り値の型:

None

KNNConstraintObjectiveSet.build(archive, population, ctx, candidate_x=None)[ソース]#

Return k nearest-neighbour archive points with raw constraint values.

パラメータ:
  • archive (Archive)

  • population (Population | None)

  • ctx (OptimizationState | None)

  • candidate_x (np.ndarray | None)

戻り値の型:

TrainingData

KNNConstraintObjectiveSet.contract()#

Return the training-set contract.

戻り値の型:

ComponentContract