Skip to content
 
 

Repository files navigation

Logo

PyPI - Python Version GitHub License codecov GitHub Actions Workflow Status

Quality Gate Status Security Rating Reliability Rating Maintainability Rating
Vulnerabilities Bugs Code Smells Lines of Code

Overview

DEAP-ER is a typed evolutionary-algorithm toolbox for Python 3.12 and newer. Register operators, run an algorithm. The published surface covers genetic algorithms and mixed encodings, tree and columnar GP (including memetic and semantic search helpers and a private Push policy loop), CMA (boxed, separable, restarting, and MO-CMA), multi-objective and quality-diversity search, case-structured selection, co-evolution and island stepping, parallel evaluation, records and checkpoints, and common benchmarks.

The library started as a rewrite of DEAP. The toolbox model is the same; the API is not a drop-in rename. Function names, parameter order, and a few contracts changed. The differences page is the migration note.

pip install deap-er
uv add deap-er

Capabilities

  • Genetic algorithms on ordinary Python containers (list, array, set, dict, tree, NumPy array, and similar), including mixed encodings and differential-evolution variation
  • Genetic programming: prefix trees (loosely typed, strongly typed, ADFs), SlimGP, columnar programs over named float64 columns with vectorized, causal-window, tape / Numba backends (population tape CSE), homologous and semantic crossover, interval certificates that skip dead tapes, and a private Push GP policy loop that evolves the search around those tapes
  • Program-search helpers: growing language, semantic descriptors, budget-capped memetic polish, Darwinian Keijzer affine scoring, and a policy step on ea_simple
  • Evolution strategies: CMA, boxed CMA, separable CMA, IPOP/BIPOP restarts, and MO-CMA
  • Multi-objective search (SPEA-II, NSGA-II, NSGA-III, SMS-EMOA, MOEA/D, AGE-MOEA-II) with optional constraint-dominance on NSGA-II
  • Quality-diversity search (MAP-Elites: grid, CVT, and unstructured archives; novelty selection and iso+line variation; teams from occupied archive cells)
  • Case-structured selection (lexicase, ε-lexicase with dynamic filter modes, batch ε-lexicase, case-subset tournament, structural meta-case regularization, informed down-sampling and generation schedules, program teams, co-evolving case exams, held-out generalization and successive-halving, and noisy fitness resample / F-Race stop)
  • Cooperative and competitive co-evolution, plus heterogeneous island stepping (step_islands, ring / fully connected / random migration, island_eval_keys)
  • Parallel evaluation with multiprocessing or Ray, plus spawned RNG streams
  • Statistics, hall of fame (JSON round-trip), evaluation cache and budget, and a NetworkX-compatible genealogy
  • Checkpoints that persist a run to disk (hof as JSON when hof_ind_cls= is set)
  • Benchmarks against common test functions
  • Worked examples of symbolic regression, particle swarm, differential evolution, MAP-Elites, mixed encoding, lexicase, columnar GP, homologous / semantic variation, and CMA (boxed, separable, restarting)

Relative to DEAP

Same toolbox model. Counted from the differences inventory:

The package is typed, uses snake_case, and is Apache-2.0. Hypervolume work delegates to moocore.

Documentation

See the documentation for the complete guide.

Performance

On the same genomes and GP expressions, deap-er is fastest where DEAP still walks Python loops. The largest shared-case gains versus DEAP 1.4.4 are lexicase selection (~68×), NSGA convergence (~45×), NSGA-II (~14×), cached compile_tree (~13×), SPEA-II (~5×), and clone_individual (~4×). Tournament selection is about 1.8× after a batched integer draw. A tiny ea_simple OneMax loop stays a bit behind (~0.87×).

Charts, the full case list, and how to reproduce are on the performance page.

Acknowledgments

DEAP-ER started as a rewrite of DEAP, originally developed at the Computer Vision and Systems Laboratory (CVSL) at Université Laval.

The original DEAP authors and main contributors, in alphabetical order:

  • François-Michel De Rainville
  • Félix-Antoine Fortin
  • Christian Gagné
  • Olivier Gagnon
  • Marc-André Gardner
  • Simon Grenier
  • Yannick Hold-Geoffroy
  • Marc Parizeau

If you use this library in a scientific paper, please also cite the original DEAP paper (see CITATION.cff):

@article{DEAP_JMLR2012,
  author  = {F{\'e}lix-Antoine Fortin and Fran{\c{c}}ois-Michel {De Rainville}
             and Marc-Andr{\'e} Gardner and Marc Parizeau and Christian Gagn{\'e}},
  title   = {{DEAP}: Evolutionary Algorithms Made Easy},
  journal = {Journal of Machine Learning Research},
  volume  = {13},
  year    = {2012},
  pages   = {2171--2175}
}

About

Distributed Evolutionary Algorithms in Python - Entirely Reinvented

Resources

Stars

15 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages