Selection#

Parent and survivor selection.

  • tournament() – the best of k random individuals;

  • double_tournament() – a fitness tournament followed by a size tournament, the nonparametric parsimony pressure of Luke and Panait (2002);

  • epsilon_lexicase() – ε-lexicase selection with the median absolute deviation of each case as threshold (La Cava, Spector and Danai, 2016);

  • nondominated_sort(), crowding_distance(), nsga2_survivors() – the elitist multi-objective selection of NSGA-II (Deb et al., 2002), used with error and complexity (and age, for age–fitness Pareto optimization, Schmidt and Lipson, 2011).

Examples#

>>> import numpy as np
>>> from eqdisco.selection import nondominated_sort
>>> F = np.array([[1, 5], [2, 3], [3, 1], [3, 4], [4, 4]])
>>> [f.tolist() for f in nondominated_sort(F)]
[[0, 1, 2], [3], [4]]

Tournament, double tournament, epsilon-lexicase, Pareto sorting and NSGA-II survival.

Functions#

tournament(fitness, n, k, rng)

Indices of n winners of tournaments of size k (smaller fitness wins).

double_tournament(fitness, sizes, n, k, rng)

Double tournament: the smaller of two fitness-tournament winners wins with probability d/2.

epsilon_lexicase(errors, n, rng[, epsilon])

ε-lexicase selection.

nondominated_sort(F)

Fast non-dominated sorting: list of fronts (index arrays), best front first.

crowding_distance(F)

Crowding distance of the members of one front (boundary points get infinity).

nsga2_survivors(F, n)

Elitist NSGA-II environmental selection of n rows of F.

crowded_tournament(ranks, crowd, n, rng[, k])

Binary (or k-ary) tournament on (rank, -crowding) as in NSGA-II.

pareto_mask(F)

Boolean mask of the non-dominated rows of F (all objectives minimized).