geppy.algorithms package¶
Submodules¶
geppy.algorithms.basic module¶
This basic
module provides fundamental boilerplate GEP algorithm implementations. After registering proper
operations into a deap.base.Toolbox
object, the GEP evolution can be simply launched using the present
algorithms. Of course, for complicated problems, you may want to define your own algorithms, and the implementation here
can be used as a reference.
-
geppy.algorithms.basic.
gep_simple
(population, toolbox, n_generations=100, n_elites=1, stats=None, hall_of_fame=None, verbose=True)[source]¶ This algorithm performs the simplest and standard gene expression programming. The flowchart of this algorithm can be found here. Refer to Chapter 3 of [FC2006] to learn more about this basic algorithm.
Note
The algorithm framework also supports the GEP-RNC algorithm, which evolves genes with an additional Dc domain for random numerical constant manipulation. To adopt
gep_simple()
for GEP-RNC evolution, use theGeneDc
objects as the genes and register Dc-specific operators. A detailed example of GEP-RNC can be found at numerical expression inference with GEP-RNC. Users can refer to Chapter 5 of [FC2006] to get familiar with the GEP-RNC theory.Parameters: - population – a list of individuals
- toolbox –
Toolbox
, a container of operators. Regarding the conventions of operator design and registration, please refer to Conventions of genetic operator design and registration in geppy. - n_generations – max number of generations to be evolved
- n_elites – number of elites to be cloned to next generation
- stats – a
Statistics
object that is updated inplace, optional. - hall_of_fame – a
HallOfFame
object that will contain the best individuals, optional. - verbose – whether or not to print the statistics.
Returns: The final population
Returns: A
Logbook
recording the statistics of the evolution process
geppy.algorithms.copt module¶
This copt
module provides advanced routines for numerical constant optimization in gene expression programming.
It is known that both genetic programming (GP) and GEP can usually find a near-optimal solution quite quickly. However,
they both have difficulty in optimizing the numerical constants integrated in the model, especially when the constants
are continuous real numbers. To optimize the constants efficiently, a local optimizer is often incorporated, i.e., GEP
mainly aims to formulate the true structure of the model, while the embedded local optimizer is dedicated to improving
the constants existent in the individuals.
To reduce computational cost, such local optimization is applied every k generations and often only applied to selected individuals. Accordingly, two arguments opt_period and opt_selector are required by the algorithms.
Such kind of algorithms combining evolutionary algorithms and local improvement procedures are often referred to as memetic algorithm in literature.
A common interface for a local optimizer is optimize(population, selector, generation, **kwargs) -> population
.