Coder Social home page Coder Social logo

moshesipper / tiny_gp Goto Github PK

View Code? Open in Web Editor NEW
92.0 6.0 36.0 822 KB

Tiny Genetic Programming in Python

License: GNU General Public License v3.0

Python 100.00%
genetic-algorithm evolutionary-algorithms evolutionary-computation evolutionary-algorithm evolution evolutionary genetic-programming python evolution-simulation tiny-genetic-programming

tiny_gp's Introduction

Tiny Genetic Programming in Python

A minimalistic program implementing Koza-style (tree-based) genetic programming to solve a symbolic regression problem.

tiny-gp.py is a basic (and fully functional) version, which produces textual output of the evolutionary progression and evolved trees.

tiny-gp-plus.py displays dynamic graphs of error and mean tree size (size = number of nodes), has a bloat-control option, and produces nicer, graphic output (you'll need to install https://pypi.org/project/graphviz/).

I invite you to check out another project of mine, which allows you to run an evolutionary algorithm with just 3 lines of code: EC-KitY โ€” Evolutionary Computation Tool Kit in Python.

If you wish to cite this:

@misc{Sipper2019tinyGP,
  author = {Sipper, M.},
  title = {Tiny Genetic Programming in Python},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/moshesipper/tiny_gp} }
}
Symbolic Regression using GP
Objective Find an expression with one input (independent variable x), whose output equals the value of the quartic function x4 + x3 + x2 + x + 1
Function set add, sub, mul
Terminal set x, -2, -1, 0, 1, 2
Fitness Inverse mean absolute error over a dataset of 101 target values, normalized to [0,1]
Paremeters POP_SIZE (population size), MIN_DEPTH (minimal initial random tree depth), MAX_DEPTH (maximal initial random tree depth), GENERATIONS (maximal number of generations), TOURNAMENT_SIZE (size of tournament for tournament selection), XO_RATE (crossover rate), PROB_MUTATION (per-node mutation probability)
Termination Maximal number of generations reached or an individual with fitness = 1.0 found
Evolved solution Another evolved solution
GPTree GPTree2
Bloat control No bloat control
GP run GP run

tiny_gp's People

Contributors

moshesipper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tiny_gp's Issues

License ?

Hello, under what license is this project released under ? Thank-you.

Bad python code formatting

Hello. I've checked tiny_gp.py and my linter found several errors in your code. Please fix them or if not let me know and I will send a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.