trevorstephens / gplearn

Genetic Programming in Python, with a scikit-learn inspired API
http://gplearn.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.56k stars 274 forks source link

Implement elitism #295

Open kolergy opened 8 months ago

kolergy commented 8 months ago

Thanks for your nice code.

Elitism is extremely simple to implement and allows to ensure that the N best elements of the population are carried to the next generation avoiding the fitness drop that can be seen when running GPlearn fit

N=1 is a good value, for very large population it can be beneficial to push it up a bit.

ref: Dejong K. (1975), An analysis of the behavior of a class of a class of genetic adaptive systems. PhD Thesis, University of Michigan.

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Additional context