saealib.LevelBasedSet#

class saealib.LevelBasedSet(source='population', n_levels=5)[ソース]#

ベースクラス: TrainingSet

Multi-class labels from equal-division of a sorted population (CA-LLSO, P1).

Individuals are sorted by ctx.comparator.sort_population (best-first), then divided into n_levels equally-sized groups. The best group receives label n_levels - 1 and the worst group receives label 0. Remainder individuals are appended to the worst (label 0) group.

パラメータ:
  • source (str) -- "archive" or "population".

  • n_levels (int) -- Number of classification levels (≥ 2).

例外:

ValueError -- If ctx is None or source="population" with population=None.

Methods

__init__

build

Return level labels from equal-size sorted groups.

contract

Return the training-set contract.

Method Details

LevelBasedSet.__init__(source='population', n_levels=5)[ソース]#
パラメータ:
  • source (str)

  • n_levels (int)

戻り値の型:

None

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

Return level labels from equal-size sorted groups.

パラメータ:
  • archive (Archive)

  • population (Population | None)

  • ctx (OptimizationState | None)

  • candidate_x (np.ndarray | None)

戻り値の型:

TrainingData

LevelBasedSet.contract()#

Return the training-set contract.

戻り値の型:

ComponentContract