saealib.LevelBasedSet#
- class saealib.LevelBasedSet(source='population', n_levels=5)[source]#
Bases:
TrainingSetMulti-class labels from equal-division of a sorted population (CA-LLSO, P1).
Individuals are sorted by
ctx.comparator.sort_population(best-first), then divided inton_levelsequally-sized groups. The best group receives labeln_levels - 1and the worst group receives label 0. Remainder individuals are appended to the worst (label 0) group.- Parameters:
source (str) –
"archive"or"population".n_levels (int) – Number of classification levels (≥ 2).
- Raises:
ValueError – If
ctxisNoneorsource="population"withpopulation=None.
Methods
Return level labels from equal-size sorted groups. |
|
Return the training-set contract. |
Method Details
- LevelBasedSet.__init__(source='population', n_levels=5)[source]#
- Parameters:
source (str)
n_levels (int)
- Return type:
None
- LevelBasedSet.build(archive, population, ctx, candidate_x=None)[source]#
Return level labels from equal-size sorted groups.
- Parameters:
archive (Archive)
population (Population | None)
ctx (OptimizationState | None)
candidate_x (np.ndarray | None)
- Return type:
- LevelBasedSet.contract()#
Return the training-set contract.
- Return type: