Package: geppy
geppy:a gene expression programming framework in Pythongeppyis a computational framework dedicated toGene Expression Programming(GEP),  which is proposed by C. Ferreira  in 2001 [1].geppyis developed in Python 3.What is GEP?Gene Expression Programming (GEP) is a popular and established evolutionary algorithm for automatic generation of computer programs and mathematical models.  It has found wide applications in symbolic regression, classification, automatic model design, combinatorial optimization and real parameter optimization problems [2].GEP can be seen as a variant of the traditionalgenetic programming(GP) and it uses simple linear chromosomes of fixed lengths to encode the genetic information. Though the chromosome (genes) is of fixed length, it can produce expression trees of various sizes thanks to its genotype-phenotype expressio system. Many experiments show that GEP is more efficient than GP, and the trees evolved by GEP tend to have a smaller size than the ones of GP.geppyandDEAPgeppyis built on top of the excellent evolutionary computation frameworkDEAPfor rapid prototyping and testing of ideas with GEP. DEAP provides fundamental support for GP, while lacking support for GEP.geppytries the best to follow the style of DEAP and attempts to maintain compatibility with the major infrastructure of DEAP. In other words, to some degreegeppymay be considered as a plugin of DEAP to specially support GEP. If you are familiar with DEAP, then it is easy to graspgeppy. Besides, comprehensivedocumentationis also available.FeaturesCompatibility with theDEAPinfrastructure and easy accessibility to DEAP's functionality including:Multi-objective optimisationStraightforward parallelization of fitness evaluations for speedupHall of Fame of the best individuals that lived in the populationCheckpoints that take snapshots of a system regularlyStatistics and loggingCore data structures in GEP, including the gene, chromosome, expression tree, and K-expression.Implementation of common mutation, transposition, inversion and crossover operators in GEP.Boilerplate algorithms, including  the standard GEP algorithm and advanced algorithms integrating a local optimizer for numerical constant optimization.Support numerical constants inference with a third Dc domain in genes: the GEP-RNC algorithm.Flexible built-in algorithm interface, which can support an arbitrary number of custom mutation and crossover-like operators.Visualization of the expression tree.Symbolic simplification of a gene, a chromosome, or a K-expression in postprocessing.Examples of different applications using  GEP with detailed comments in Jupyter notebook.InstallationFrom PyPI (recommended)pipinstallgeppyFrom sourceYou can install it from sources.First download or clone this repositorygitclonehttps://github.com/ShuhuaGao/geppyChange into the root directory, i.e., the one containing thesetup.pyfile and installgeppyusingpipcdgeppy
pipinstall.DocumentationCheckgeppydocumentationfor GEP theory and tutorials as well as a comprehensive introduction ofgeppy's API and typical usages with comprehensive tutorials and examples.ExamplesA getting started example is presented in the Jupyter notebookBoolean model identification, which infers a Boolean function from given input-output data with GEP. More examples are listed in the following.Simple symbolic regressionBoolean model identification(Getting started with no constants involved)Simple mathematical expression inference(Constants finding with ephemeral random constants (ERC))Simple mathematical expression inference with the GEP-RNC algorithm(Demonstrating the GEP-RNC algorithm for numerical constant evolution)Advanced symbolic regressionImproving symbolic regression with linear scaling(Use the linear scaling technique to evolve models with continuous real constants more efficiently)Use the GEP-RNC algorithm with linear scaling on  the UCI Power Plant datasetSee how to apply GEP based symbolic regression on a real machine learning dataset.RequirementsPython 3.6 and afterwardsDEAP, which should be installed automatically if you haven't got it when installinggeppy.[optional] To visualize the expression tree using thegeppy.export_expression_treemethod, you need thegraphvizmodule.[optional] Since GEP/GP doesn't simplify the expressions during evolution, its final result may contain many redundancies, and the tree can be very large,  likex + 5 * (2 * x - x - x) - 1,  which is simplyx - 1. You may like to simplify the final model evolved by GEP with symbolic computation to get better understanding of this model. The correspondinggeppy.simplifymethod depends on thesympypackage.Common pitfalls in using GPAlways keep in mind that evolution is random. Thus, any values may be input into a function. If issues like "overflow", "nan", or "not a number", or unreasonally huge values are encounterred, the most possible reason is that you did not protect a possiblydangerousfunction. For example, if thesqrtfunction lies in the function set, then in evaluating one individual evolved bygeppy(or GP in general), it is likely that a negative inputsqrt(-1.24)may happen.Refer to issues#28#26#4for more details.ReferenceThe bible of GEP is definitely Ferreira, C.'s monograph:Ferreira, C. (2006). Gene expression programming: mathematical modeling by an artificial intelligence (Vol. 21). Springer.You can also get a lot of papers/documents by Googling 'gene expression programming'.[1] Ferreira, C. (2001). Gene Expression Programming: a New Adaptive Algorithm for Solving Problems. Complex Systems, 13.
[2] Zhong, J., Feng, L., & Ong, Y. S. (2017). Gene expression programming: a survey. IEEE Computational Intelligence Magazine, 12(3), 54-72.How to citegeppyIf you findgeppyuseful in your projects, please cite it such that more researchers/engineers will know it. A BibTeX entry forgeppyis given below.@misc{geppy_2020,
    author       = {Shuhua Gao},
    title        = {{geppy: a Python framework for gene expression programming }},
    month        = July,
    year         = 2020,
    doi          = {10.5281/zenodo.3946297},
    version      = {0.1},
    publisher    = {Zenodo},
    url          = {https://github.com/ShuhuaGao/geppy}
    }Alternatively, if you want a moreacademiccitation, you may cite our relevant paper@ARTICLE{learn_async,
  author={S. {Gao} and C. {Sun} and C. {Xiang} and K. {Qin} and T. H. {Lee}},
  journal={IEEE Transactions on Cybernetics}, 
  title={Learning Asynchronous Boolean Networks From Single-Cell Data Using Multiobjective Cooperative Genetic Programming}, 
  year={2020},
  volume={},
  number={},
  pages={1-15},
  doi={10.1109/TCYB.2020.3022430}}