1.5. Selection

1.5.1. selNSGA2

surrogate.selection.selNSGA2()[source]

Apply NSGA-II selection operator on the individuals. Usually, the size of individuals will be larger than k because any individual present in individuals will appear in the returned list at most once. Having the size of individuals equals to k will have no effect other than sorting the population according to their front rank. The list returned contains references to the input individuals. For more details on the NSGA-II operator see [Deb2002].

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
  • nd – Specify the non-dominated algorithm to use: ‘standard’ or ‘log’.
Returns:

A list of selected individuals.

[Deb2002]Deb, Pratab, Agarwal, and Meyarivan, “A fast elitist non-dominated sorting genetic algorithm for multi-objective optimization: NSGA-II”, 2002.

1.5.2. selSPEA2

surrogate.selection.selSPEA2()[source]

Apply SPEA-II selection operator on the individuals. Usually, the size of individuals will be larger than n because any individual present in individuals will appear in the returned list at most once. Having the size of individuals equals to n will have no effect other than sorting the population according to a strength Pareto scheme. The list returned contains references to the input individuals. For more details on the SPEA-II operator see [Zitzler2001].

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
Returns:

A list of selected individuals.

[Zitzler2001]Zitzler, Laumanns and Thiele, “SPEA 2: Improving the strength Pareto evolutionary algorithm”, 2001.

1.5.3. selBest

surrogate.selection.selBest()[source]

Select the k best individuals among the input individuals. The list returned contains references to the input individuals.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
Returns:

A list containing the k best individuals.

1.5.4. selDoubleTournament

surrogate.selection.selDoubleTournament()[source]

Tournament selection which use the size of the individuals in order to discriminate good solutions. This kind of tournament is obviously useless with fixed-length representation, but has been shown to significantly reduce excessive growth of individuals, especially in GP, where it can be used as a bloat control technique (see [Luke2002fighting]). This selection operator implements the double tournament technique presented in this paper.

The core principle is to use a normal tournament selection, but using a special sample function to select aspirants, which is another tournament based on the size of the individuals. To ensure that the selection pressure is not too high, the size of the size tournament (the number of candidates evaluated) can be a real number between 1 and 2. In this case, the smaller individual among two will be selected with a probability size_tourn_size/2. For instance, if size_tourn_size is set to 1.4, then the smaller individual will have a 0.7 probability to be selected.

Note

In GP, it has been shown that this operator produces better results when it is combined with some kind of a depth limit.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
  • fitness_size – The number of individuals participating in each fitness tournament
  • parsimony_size – The number of individuals participating in each size tournament. This value has to be a real number in the range [1,2], see above for details.
  • fitness_first – Set this to True if the first tournament done should be the fitness one (i.e. the fitness tournament producing aspirants for the size tournament). Setting it to False will behaves as the opposite (size tournament feeding fitness tournaments with candidates). It has been shown that this parameter does not have a significant effect in most cases (see [Luke2002fighting]).
Returns:

A list of selected individuals.

[Luke2002fighting](1, 2) Luke and Panait, 2002, Fighting bloat with nonparametric parsimony pressure

1.5.5. selRandom

surrogate.selection.selRandom()[source]

Select k individuals at random from the input individuals with replacement. The list returned contains references to the input individuals.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
Returns:

A list of selected individuals.

This function uses the choice() function from the python base random module.

1.5.6. selRoulette

surrogate.selection.selRoulette()[source]

Select k individuals from the input individuals using k spins of a roulette. The selection is made by looking only at the first objective of each individual. The list returned contains references to the input individuals.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
Returns:

A list of selected individuals.

This function uses the random() function from the python base random module.

Warning

The roulette selection by definition cannot be used for minimization or when the fitness can be smaller or equal to 0.

1.5.7. selStochasticUniversalSampling

surrogate.selection.selStochasticUniversalSampling()[source]

Select the k individuals among the input individuals. The selection is made by using a single random value to sample all of the individuals by choosing them at evenly spaced intervals. The list returned contains references to the input individuals.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
Returns:

A list of selected individuals.

This function uses the uniform() function from the python base random module.

1.5.8. selTournament

surrogate.selection.selTournament()[source]

Select k individuals from the input individuals using k tournaments of tournsize individuals. The list returned contains references to the input individuals.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
  • tournsize – The number of individuals participating in each tournament.
Returns:

A list of selected individuals.

This function uses the choice() function from the python base random module.

1.5.9. selTournamentDCD

surrogate.selection.selTournamentDCD()[source]

Tournament selection based on dominance (D) between two individuals, if the two individuals do not interdominate the selection is made based on crowding distance (CD). The individuals sequence length has to be a multiple of 4. Starting from the beginning of the selected individuals, two consecutive individuals will be different (assuming all individuals in the input list are unique). Each individual from the input list won’t be selected more than twice.

This selection requires the individuals to have a crowding_dist attribute, which can be set by the assignCrowdingDist() function.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
Returns:

A list of selected individuals.

1.5.10. selWorst

surrogate.selection.selWorst()[source]

Select the k worst individuals among the input individuals. The list returned contains references to the input individuals.

Parameters:
  • individuals – A list of individuals to select from.
  • k – The number of individuals to select.
Returns:

A list containing the k worst individuals.