saealib.KNNConstraintObjectiveSet#
- class saealib.KNNConstraintObjectiveSet(n_neighbors=50)[source]#
Bases:
TrainingSetRetrieve the k nearest archive neighbours of
candidate_x.Analogue of
KNNObjectiveSetfor constraint surrogates. Returns the k-NN subset of(archive.x, archive.g)centred oncandidate_x.- Parameters:
n_neighbors (int) – Number of nearest neighbours to retrieve.
- Raises:
ValueError – If
candidate_xis None, or if the archive has no constraint columns.
Methods
Return k nearest-neighbour archive points with raw constraint values. |
|
Return the training-set contract. |
Method Details
- KNNConstraintObjectiveSet.__init__(n_neighbors=50)[source]#
- Parameters:
n_neighbors (int)
- Return type:
None
- KNNConstraintObjectiveSet.build(archive, population, ctx, candidate_x=None)[source]#
Return k nearest-neighbour archive points with raw constraint values.
- Parameters:
archive (Archive)
population (Population | None)
ctx (OptimizationState | None)
candidate_x (np.ndarray | None)
- Return type:
- KNNConstraintObjectiveSet.contract()#
Return the training-set contract.
- Return type: