bingo.selection package#

Submodules#

bingo.selection.age_fitness module#

Age-Fitness selection

This module implements the Age-Fitness selection algorithm that defines the selection used in the Age-Fitness evolutionary algorithm module. This module expects to be used in conjunction with the RandomIndividualVariation module that wraps the VarOr module.

class bingo.selection.age_fitness.AgeFitness(selection_size=2)#

Bases: Selection

Age-Fitness selection

Parameters:

selection_size (int) – The size of the group of individuals to be randomly compared. The size must be an integer greater than 1.

WORST_CASE_FACTOR = 50#

bingo.selection.deterministic_crowding module#

The “Deterministic Crowding” selection

This module defines the basis of the “deterministic crowding” selection algorithm in bingo analyses. The next generation is selected by pairing parents with their offspring and selecting the most fit of the two.

class bingo.selection.deterministic_crowding.DeterministicCrowding#

Bases: GeneralizedCrowding

The class that performs deterministic crowding selection on a population

Parameters:
  • population (list of Chromosome) – The population on which to perform selection. This population includes both the parent and child populations, with the parents in the first half and the children in the latter half

  • target_population_size (int) – The size of the next generation

Returns:

population – The newly selected generation of chromosomes

Return type:

list of Chromosome

bingo.selection.generalized_crowding module#

The base for generalized crowding selection

This module defines the basis of the generalized crowding selection algorithm in bingo analyses. The next generation is selected by pairing parents with their offspring and selecting the most fit of the two.

class bingo.selection.generalized_crowding.GeneralizedCrowding#

Bases: Selection

The class that performs generalized crowding selection on a population

bingo.selection.probabilistic_crowding module#

The “Probabilistic Crowding” selection

This module defines the basis of the probabilistic crowding selection algorithm in bingo analyses. The next generation is selected by pairing parents with their offspring and selecting the child with a probility that is related to the fitness of the paired child and parent.

class bingo.selection.probabilistic_crowding.ProbabilisticCrowding(log_scale=True, negative=False)#

Bases: GeneralizedCrowding

Crowding using probabilistic model selection

Fitness of individuals are assumed to be a measure of model evidence, such that a ratio between two fitness values gives the Bayes Factor.

Parameters:
  • log_scale (bool) – Whether fitnesses of the individuals is in log space. Default True.

  • negative (bool) – Whether to invert the fitness of the individual (before log). Default True.

bingo.selection.probabilistic_tournament module#

Probabilistic model selection tournament

An modification of the standard tournament selection process which is probabilistic and weights the chances for selection by the fitness of the individuals in the tournament.

class bingo.selection.probabilistic_tournament.ProbabilisticTournament(tournament_size, logscale=True, negative=False)#

Bases: Selection

Tournament selection using probabilistic model selection

Individuals are chosen with a probability equal to the relative vale of their fitness. When used in conjunction with NormalizedMarginalLikelihood this results in selection with Bayesian Model Selection (Based on the Fractional Bayes Factor)

Parameters:
  • tournament_size (int) – size of the tournament

  • logscale (bool) – Whether fitnesses of the individuals is in log space. Default True.

  • negative (bool) – Whether to invert the fitness of the individual (before log). Default True.

bingo.selection.selection module#

The genetic operation of selection.

This module defines the basis of selection in bingo evolutionary analyses.

class bingo.selection.selection.Selection#

Bases: object

A selector of fit individuals.

An abstract base class for the selection of genetic individuals (chromosomes) in bingo.

bingo.selection.tournament module#

Tournament selection

Tournament selection involves running several “tournaments” among a few individuals (or “chromosomes”) chosen at random from the population. The winner of each tournament (the one with the smallest fitness) is selected to advance into the next generation.

class bingo.selection.tournament.Tournament(tournament_size)#

Bases: Selection

Tournament selection

This class defines the function for tournament selection in a population. In the tournaments random individuals from the population are chosen; the most fit individual from that set advances to the next generation. Tournaments repeat until the target population size for the next generation is met.

Parameters:

tournament_size (int) – The size of the tournaments

Module contents#