{ "info": { "author": "Arthur Amstutz", "author_email": "arthur.amstutz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "# Evolutionary Algorithm \\- Genetic Programming\n\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/amstuta/genetic.py/blob/master/LICENSE.md)\n\nThis package is a high-level library implementing a\ngenetic programming algorithm using a tree representation for individuals. It\nis compatible with Python 2.7 and all the following versions and uses only the\nstandard library (no dependencies).\n\nIt can be used to solve linear and nonlinear regression problems and is\nusable through a simple interface:\n- A fit function that takes as inputs the training examples, target values and the number of iterations\n- A predict function that takes as parameter an input for prediction\n\nAn example of usage can be found in the example.py script. This example requires to\nhave the libraries numpy and matplotlib installed.\n\n### Installation\n\nThe package can be installed simply using Pypi:\n```sh\npip install genetic\n```\n\n### Usage\n\nTo use it, you need to give the algorithm:\n- A fitness function that takes as parameters:\n - An instance of the class Tree\n - The training examples: array-like object of shape [n_samples, n_features]\n - The target values: array-like object of shape [n_samples]\n- The function set that can be used in the tree\n\nBasic example:\n```python\nfrom operator import add, sub, mul\nfrom genetic.core import EvolutionaryAlgorithm\n\n# Load your dataset\ntrain_features, train_targets = ...\ntest_features, test_targets = ...\n\n# Define a fitness function\ndef compute_fitness(tree, features, targets):\n ...\n return fitness\n\n# Define the parameters of the algorithm\nparameters = {\n 'min_depth': 2,\n 'max_depth': 5,\n 'nb_trees': 50,\n 'max_const': 100,\n 'func_ratio': 0.5,\n 'var_ratio': 0.5,\n 'crossover_prob': 0.8,\n 'mutation_prob': 0.2,\n 'iterations': 80,\n 'functions': [add,sub,mul],\n 'fitness_function': compute_fitness\n}\n\n# Create object and train algorithm\nea = EvolutionaryAlgorithm(**parameters)\nea.fit(train_features, train_targets)\n\n# Make a prediction\npredicted = ea.predict(test_features[0])\n```\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amstuta/genetic.py", "keywords": "genetic evolution intelligence data learning", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "genepy", "package_url": "https://pypi.org/project/genepy/", "platform": "", "project_url": "https://pypi.org/project/genepy/", "project_urls": { "Homepage": "https://github.com/amstuta/genetic.py" }, "release_url": "https://pypi.org/project/genepy/1.0.0b1/", "requires_dist": null, "requires_python": "", "summary": "Simple genetic programming library using tree representation for individuals", "version": "1.0.0b1" }, "last_serial": 2932577, "releases": { "1.0.0b1": [ { "comment_text": "", "digests": { "md5": "657ca41c7ddcbafe2a0bf25e4e67ac87", "sha256": "2f09bb546a02a28cad187101fa9c1d7901e0834de0cf0a976937cca106d8ac07" }, "downloads": -1, "filename": "genepy-1.0.0b1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "657ca41c7ddcbafe2a0bf25e4e67ac87", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13744, "upload_time": "2017-06-07T15:43:08", "url": "https://files.pythonhosted.org/packages/e3/18/e4f954b24f277ba6c437db2acd1cc6a279daf86b42052a2ba4228dd906e3/genepy-1.0.0b1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d979eb0fecab0aff1c090b9d86ab36e", "sha256": "151011d9c63f75dfd9bbf058998486c72538637d7227c775352ef080671c27b2" }, "downloads": -1, "filename": "genepy-1.0.0b1.tar.gz", "has_sig": false, "md5_digest": "5d979eb0fecab0aff1c090b9d86ab36e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6004, "upload_time": "2017-06-07T15:43:09", "url": "https://files.pythonhosted.org/packages/2d/ad/e26cb513ec9b8eb3614b252d84f2afab21be7911ae7bfe1c61452b5ff2c9/genepy-1.0.0b1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "657ca41c7ddcbafe2a0bf25e4e67ac87", "sha256": "2f09bb546a02a28cad187101fa9c1d7901e0834de0cf0a976937cca106d8ac07" }, "downloads": -1, "filename": "genepy-1.0.0b1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "657ca41c7ddcbafe2a0bf25e4e67ac87", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13744, "upload_time": "2017-06-07T15:43:08", "url": "https://files.pythonhosted.org/packages/e3/18/e4f954b24f277ba6c437db2acd1cc6a279daf86b42052a2ba4228dd906e3/genepy-1.0.0b1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5d979eb0fecab0aff1c090b9d86ab36e", "sha256": "151011d9c63f75dfd9bbf058998486c72538637d7227c775352ef080671c27b2" }, "downloads": -1, "filename": "genepy-1.0.0b1.tar.gz", "has_sig": false, "md5_digest": "5d979eb0fecab0aff1c090b9d86ab36e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6004, "upload_time": "2017-06-07T15:43:09", "url": "https://files.pythonhosted.org/packages/2d/ad/e26cb513ec9b8eb3614b252d84f2afab21be7911ae7bfe1c61452b5ff2c9/genepy-1.0.0b1.tar.gz" } ] }