GeneticEngine


NameGeneticEngine JSON
Version 0.8.4 PyPI version JSON
download
home_pagehttp://github.com/alcides/GeneticEngine/
SummaryGenetic Programming with Types and Grammars
upload_time2024-01-31 22:57:14
maintainer
docs_urlNone
authorAlcides Fonseca
requires_python>=3.9
licensehttps://opensource.org/licenses/MIT
keywords evolutionary computation genetic programming regression machine learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Genetic Engine
==============

[![Documentation](https://readthedocs.org/projects/geneticengine/badge/?version=latest)](https://geneticengine.readthedocs.io/en/latest/)
[![codecov](https://codecov.io/gh/alcides/GeneticEngine/branch/main/graph/badge.svg?token=ZX84SA7IEP)](https://codecov.io/gh/alcides/GeneticEngine)

A hybrid between strongly-typed (STGP) and grammar-guided genetic programming (GGGP).

About GeneticEngine
-------------------

GeneticEngine is a Genetic Programming framework for single- and multi-objective optimization. GeneticEngine allows the user to provide domain knowledge about the shape of the solution (using type annotations) and by defining the fitness function.


Documentation
-------------

* [Documentation](https://geneticengine.readthedocs.io/)
* [Examples](examples/)

```python
class MyExpr(ABC):
	"MyExpr is a non-terminal/abstract class."
	def eval(self):
		...

@dataclass
class Plus(MyExpr):
	"E -> E + E"
	left: MyExpr
	right: MyExpr

	def eval(self):
		return self.left.eval() + self.right.eval()

@dataclass
class Literal(MyExpr):
	"E -> <int>"
	value: int

	def eval(self):
		return self.value
```

In this small example, we are defining the language that supports the plus operator and integer literals. GeneticEngine will be able to automatically generate all possible expressions, such as `Plus(left=Plus(left=Literal(12), right=Literal(12)), right=Literal(15))`, and guide the search towards your goal (e.g., `lambda x: abs(x-2022)`). For this very simple toy problem, it will find an expression that computes 2022, ideally as small as possible. And this is a very uninteresting example. But if you introduce variables into the mix, you have a very powerful symbolic regression toolkit for arbitrarily complex expressions.


Contributing
-------------

After cloning the repo, please run `source setup_dev.sh` to install virtualenv, all dependencies and setup all pre-commit hooks.

Pull Requests are more than welcome!


Authors
----------
GeneticEngine has been developed at [LASIGE](https://www.lasige.pt), [University of Lisbon](https://ciencias.ulisboa.pt) by:

* [Alcides Fonseca](http://alcidesfonseca.com)
* [Leon Ingelse](https://leoningel.github.io)
* [Guilherme Espada](https://www.lasige.di.fc.ul.pt/user/732)
* [Paulo Santos](https://pcanelas.com/)
* [Pedro Barbosa](https://www.lasige.di.fc.ul.pt/user/661)
* [Eduardo Madeira](https://www.lasige.pt/member/jose-eduardo-madeira)

Acknowledgements
----------------

This work was supported by Fundação para a Ciência e Tecnologia (FCT) through:

* [the LASIGE Research Unit](https://www.lasige.pt) (ref. UIDB/00408/2020 and UIDP/00408/2020)
* Pedro Barbosa PhD fellowship (SFRH/BD/137062/2018)
* Guilherme Espada PhD fellowship (UI/BD/151179/2021)
* Paulo Santos CMU|Portugal PhD fellowship (SFRH/BD/151469/2021)
* [the FCT Exploratory project RAP](http://wiki.alcidesfonseca.com/research/projects/rap/) (EXPL/CCI-COM/1306/2021)
* the FCT Advanced Computing projects (2022.15800.CPCA.A1, CPCA/A1/395424/2021, CPCA/A1/5613/2020, CPCA/A2/6009/2020)

And by Lisboa2020, Compete2020 and FEDER through:

* [the CMU|Portugal CAMELOT project](http://wiki.alcidesfonseca.com/research/projects/camelot/) (LISBOA-01-0247-FEDER-045915)


Publications
-----------------

* [Comparing the expressive power of Strongly-Typed and Grammar-Guided Genetic Programming](https://www.researchgate.net/publication/370277603_Comparing_the_expressive_power_of_Strongly-Typed_and_Grammar-Guided_Genetic_Programming) at GECCO'23
* [Data types as a more ergonomic frontend for Grammar-Guided Genetic Programming](https://arxiv.org/pdf/2210.04826) at GPCE'22
* [Grammatical Evolution Mapping for Semantically-Constrained Genetic Programming](https://www.researchgate.net/profile/Alcides-Fonseca/publication/358528379_Grammatical_Evolution_Mapping_for_Semantically-Constrained_Genetic_Programming/links/620a1ecf634ff774f4cc2cee/Grammatical-Evolution-Mapping-for-Semantically-Constrained-Genetic-Programming.pdf) at GPTP'21
* [The Usability Argument for Refinement Typed Genetic Programming](https://link.springer.com/chapter/10.1007/978-3-030-58115-2_2) at PPSN'20

Applications of GeneticEngine
-----------------------------

* [Comparing Individual Representations in Grammar-Guided Genetic Programming for Glucose Prediction in People with Diabetes](https://www.researchgate.net/publication/371324298_Comparing_Individual_Representations_in_Gram-mar-Guided_Genetic_Programming_for_Glucose_Prediction_in_People_with_Diabetes) at Grammatical Workshop at GECCO'23
* [Domain-Aware Feature Learning with Grammar-Guided Genetic Programming](https://link.springer.com/chapter/10.1007/978-3-031-29573-7_15) at EuroGP'23
* [Benchmarking Individual Representation in Grammar-Guided Genetic Programming](https://wwwww.easychair.org/publications/preprint_download/wqrb) at Evo*'22


Let us know if your paper uses Genetic Engine, to list it here.

Please cite as:

```
Espada, Guilherme, et al. "Data types as a more ergonomic frontend for Grammar-Guided Genetic Programming.", GPCE '22: Concepts and Experiences, 2022
```

Bibtex:

```
@inproceedings{espada2022data,
  author={Guilherme Espada and Leon Ingelse and Paulo Canelas and Pedro Barbosa and Alcides Fonseca},
  editor    = {Bernhard Scholz and Yukiyoshi Kameyama},
  title={Datatypes as a More Ergonomic Frontend for Grammar-Guided Genetic Programming},
  booktitle = {{GPCE} '22: Concepts and Experiences, Auckland, NZ, December 6 - 7, 2022},
  pages     = {1},
  publisher = {{ACM}},
  year      = {2022},
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/alcides/GeneticEngine/",
    "name": "GeneticEngine",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "evolutionary computation, genetic programming, regression, machine learning",
    "author": "Alcides Fonseca",
    "author_email": "Guilherme Espada <gjespada@fc.ul.pt>, Leon Ingelse <leoningelse@gmail.com>, Paulo Santos <pacsantos@fc.ul.pt>, Pedro Barbosa <psbarbosa@ciencias.ulisboa.pt>, Alcides Fonseca <me@alcidesfonseca.com>",
    "download_url": "https://files.pythonhosted.org/packages/42/05/31f848787efb2232ab170d36a71440a3a4eea4a19601ad0c537fd5bef8d5/GeneticEngine-0.8.4.tar.gz",
    "platform": null,
    "description": "Genetic Engine\n==============\n\n[![Documentation](https://readthedocs.org/projects/geneticengine/badge/?version=latest)](https://geneticengine.readthedocs.io/en/latest/)\n[![codecov](https://codecov.io/gh/alcides/GeneticEngine/branch/main/graph/badge.svg?token=ZX84SA7IEP)](https://codecov.io/gh/alcides/GeneticEngine)\n\nA hybrid between strongly-typed (STGP) and grammar-guided genetic programming (GGGP).\n\nAbout GeneticEngine\n-------------------\n\nGeneticEngine is a Genetic Programming framework for single- and multi-objective optimization. GeneticEngine allows the user to provide domain knowledge about the shape of the solution (using type annotations) and by defining the fitness function.\n\n\nDocumentation\n-------------\n\n* [Documentation](https://geneticengine.readthedocs.io/)\n* [Examples](examples/)\n\n```python\nclass MyExpr(ABC):\n\t\"MyExpr is a non-terminal/abstract class.\"\n\tdef eval(self):\n\t\t...\n\n@dataclass\nclass Plus(MyExpr):\n\t\"E -> E + E\"\n\tleft: MyExpr\n\tright: MyExpr\n\n\tdef eval(self):\n\t\treturn self.left.eval() + self.right.eval()\n\n@dataclass\nclass Literal(MyExpr):\n\t\"E -> <int>\"\n\tvalue: int\n\n\tdef eval(self):\n\t\treturn self.value\n```\n\nIn this small example, we are defining the language that supports the plus operator and integer literals. GeneticEngine will be able to automatically generate all possible expressions, such as `Plus(left=Plus(left=Literal(12), right=Literal(12)), right=Literal(15))`, and guide the search towards your goal (e.g., `lambda x: abs(x-2022)`). For this very simple toy problem, it will find an expression that computes 2022, ideally as small as possible. And this is a very uninteresting example. But if you introduce variables into the mix, you have a very powerful symbolic regression toolkit for arbitrarily complex expressions.\n\n\nContributing\n-------------\n\nAfter cloning the repo, please run `source setup_dev.sh` to install virtualenv, all dependencies and setup all pre-commit hooks.\n\nPull Requests are more than welcome!\n\n\nAuthors\n----------\nGeneticEngine has been developed at [LASIGE](https://www.lasige.pt), [University of Lisbon](https://ciencias.ulisboa.pt) by:\n\n* [Alcides Fonseca](http://alcidesfonseca.com)\n* [Leon Ingelse](https://leoningel.github.io)\n* [Guilherme Espada](https://www.lasige.di.fc.ul.pt/user/732)\n* [Paulo Santos](https://pcanelas.com/)\n* [Pedro Barbosa](https://www.lasige.di.fc.ul.pt/user/661)\n* [Eduardo Madeira](https://www.lasige.pt/member/jose-eduardo-madeira)\n\nAcknowledgements\n----------------\n\nThis work was supported by Funda\u00e7\u00e3o para a Ci\u00eancia e Tecnologia (FCT) through:\n\n* [the LASIGE Research Unit](https://www.lasige.pt) (ref. UIDB/00408/2020 and UIDP/00408/2020)\n* Pedro Barbosa PhD fellowship (SFRH/BD/137062/2018)\n* Guilherme Espada PhD fellowship (UI/BD/151179/2021)\n* Paulo Santos CMU|Portugal PhD fellowship (SFRH/BD/151469/2021)\n* [the FCT Exploratory project RAP](http://wiki.alcidesfonseca.com/research/projects/rap/) (EXPL/CCI-COM/1306/2021)\n* the FCT Advanced Computing projects (2022.15800.CPCA.A1, CPCA/A1/395424/2021, CPCA/A1/5613/2020, CPCA/A2/6009/2020)\n\nAnd by Lisboa2020, Compete2020 and FEDER through:\n\n* [the CMU|Portugal CAMELOT project](http://wiki.alcidesfonseca.com/research/projects/camelot/) (LISBOA-01-0247-FEDER-045915)\n\n\nPublications\n-----------------\n\n* [Comparing the expressive power of Strongly-Typed and Grammar-Guided Genetic Programming](https://www.researchgate.net/publication/370277603_Comparing_the_expressive_power_of_Strongly-Typed_and_Grammar-Guided_Genetic_Programming) at GECCO'23\n* [Data types as a more ergonomic frontend for Grammar-Guided Genetic Programming](https://arxiv.org/pdf/2210.04826) at GPCE'22\n* [Grammatical Evolution Mapping for Semantically-Constrained Genetic Programming](https://www.researchgate.net/profile/Alcides-Fonseca/publication/358528379_Grammatical_Evolution_Mapping_for_Semantically-Constrained_Genetic_Programming/links/620a1ecf634ff774f4cc2cee/Grammatical-Evolution-Mapping-for-Semantically-Constrained-Genetic-Programming.pdf) at GPTP'21\n* [The Usability Argument for Refinement Typed Genetic Programming](https://link.springer.com/chapter/10.1007/978-3-030-58115-2_2) at PPSN'20\n\nApplications of GeneticEngine\n-----------------------------\n\n* [Comparing Individual Representations in Grammar-Guided Genetic Programming for Glucose Prediction in People with Diabetes](https://www.researchgate.net/publication/371324298_Comparing_Individual_Representations_in_Gram-mar-Guided_Genetic_Programming_for_Glucose_Prediction_in_People_with_Diabetes) at Grammatical Workshop at GECCO'23\n* [Domain-Aware Feature Learning with Grammar-Guided Genetic Programming](https://link.springer.com/chapter/10.1007/978-3-031-29573-7_15) at EuroGP'23\n* [Benchmarking Individual Representation in Grammar-Guided Genetic Programming](https://wwwww.easychair.org/publications/preprint_download/wqrb) at Evo*'22\n\n\nLet us know if your paper uses Genetic Engine, to list it here.\n\nPlease cite as:\n\n```\nEspada, Guilherme, et al. \"Data types as a more ergonomic frontend for Grammar-Guided Genetic Programming.\", GPCE '22: Concepts and Experiences, 2022\n```\n\nBibtex:\n\n```\n@inproceedings{espada2022data,\n  author={Guilherme Espada and Leon Ingelse and Paulo Canelas and Pedro Barbosa and Alcides Fonseca},\n  editor    = {Bernhard Scholz and Yukiyoshi Kameyama},\n  title={Datatypes as a More Ergonomic Frontend for Grammar-Guided Genetic Programming},\n  booktitle = {{GPCE} '22: Concepts and Experiences, Auckland, NZ, December 6 - 7, 2022},\n  pages     = {1},\n  publisher = {{ACM}},\n  year      = {2022},\n}\n```\n",
    "bugtrack_url": null,
    "license": "https://opensource.org/licenses/MIT",
    "summary": "Genetic Programming with Types and Grammars",
    "version": "0.8.4",
    "project_urls": {
        "Homepage": "http://github.com/alcides/GeneticEngine/",
        "documentation": "https://github.com/alcides/GeneticEngine/",
        "homepage": "https://github.com/alcides/GeneticEngine/",
        "repository": "https://github.com/alcides/GeneticEngine/"
    },
    "split_keywords": [
        "evolutionary computation",
        " genetic programming",
        " regression",
        " machine learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d4656514a97ab486e0bdcc17ac05479e4dac6737b61ba02d04fcdd967451c57",
                "md5": "9e51ab67a55e8f27d1d99daf178f3e99",
                "sha256": "0d612a28e1c5bd4d8783d122591e915722e9473811bcdeeab9c9640005d3f52d"
            },
            "downloads": -1,
            "filename": "GeneticEngine-0.8.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9e51ab67a55e8f27d1d99daf178f3e99",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 109780,
            "upload_time": "2024-01-31T22:57:12",
            "upload_time_iso_8601": "2024-01-31T22:57:12.420312Z",
            "url": "https://files.pythonhosted.org/packages/3d/46/56514a97ab486e0bdcc17ac05479e4dac6737b61ba02d04fcdd967451c57/GeneticEngine-0.8.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "420531f848787efb2232ab170d36a71440a3a4eea4a19601ad0c537fd5bef8d5",
                "md5": "d157a09d8e739852a93e25e8b49d8852",
                "sha256": "8eb13df669045fb18a65b4bc2ead627e989eab478ed7b2d00ff51642ec7b0449"
            },
            "downloads": -1,
            "filename": "GeneticEngine-0.8.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d157a09d8e739852a93e25e8b49d8852",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 70399,
            "upload_time": "2024-01-31T22:57:14",
            "upload_time_iso_8601": "2024-01-31T22:57:14.577951Z",
            "url": "https://files.pythonhosted.org/packages/42/05/31f848787efb2232ab170d36a71440a3a4eea4a19601ad0c537fd5bef8d5/GeneticEngine-0.8.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 22:57:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "alcides",
    "github_project": "GeneticEngine",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "geneticengine"
}
        
Elapsed time: 0.17110s