Selection
pangadfs.select
¶
SelectDefault()
¶
Bases: SelectBase
Source code in pangadfs/base.py
select(*, population, population_fitness, n, method='roulette', **kwargs)
¶
Select individuals in population using specified method.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
population
|
ndarray
|
the population to mutate. Shape is n_individuals x n_chromosomes. |
required |
population_fitness
|
ndarray
|
the population fitness. Is a 1D array same length as population. |
required |
n
|
int
|
total number of individuals to select |
required |
method
|
str
|
'roulette', 'su', 'scaled'; default 'roulette' |
'roulette'
|
**kwargs
|
keyword arguments for plugins |
{}
|
Returns:
Type | Description |
---|---|
ndarray
|
np.ndarray: selected population |