# Evogression
Evogression is a Python package providing an evolutionary algorithm to develop a regression function for a target parameter. An arbitrary number of input parameters can be used, and data samples need not have all parameters populated to be used in training the regression.
As of version 0.7.0, the core calculations are rewritten in Rust for much improved performance (~10x) compared to the previous Cython design.
# Quickstart
- Use pip to install Evogression
```
pip install evogression
```
- Format your input data as a list of dictionaries.
- Run the following to generate a regression function and then output this function as a python module:
```
import evogression
evolution = evogression.Evolution('target_variable_key', data, num_creatures=10000, num_cycles=10)
evolution.output_regression()
```
- At this point, there will be a "regression_function.py" file within a newly-created "regression_modules" directory. The "regression" function within this Python module can be imported and used with a dictionary of inputs to generate an estimated output value.
# Current Features
- The goal of the evolution algorithm is to generate a group of "creatures" (each a unique regression function) which then compete to most accurately model the training data. Creatures are saved when they are better at modeling results than their peers, and a survival-of-the-fittest situation emerges. Creatures mutate individually and with other creatures to search for better solutions.
- groups.py provides high-level approaches to regression by running multiple evolution groups.
- Parameter pruning algorithm can determine the most useful attributes in a dataset and progressively discard the least useful data while determining a best fit equation for the target attribute.
# Testing
- Brute force generation of creatures successfully models linear and parabolic 2D data.
<img src="tests/images/linear_regression_single_layer_brute_force_test.png" width="550px">
- Evolution algorithm successfully models linear and parabolic 2D data.
<img src="tests/images/parabola_regression_evolution_test.png" width="550px">
- Evolution algorithm successfully uses a surface to approximate 3D data using two input attributes; this illustrates how multivariate relationships can be modeled. While the case of two inputs is visualized below, any number of input attributes can be used to build a regression function.
<img src="tests/images/surface_regression_evolution_test_10seed.png" width="550px">
- A "Population" can develop separate prediction models for data separated into different categories.
<img src="tests/images/population_test.png" width="550px">
License
----
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/zachbateman/evogression.git",
"name": "evogression",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "REGRESSION, MACHINE, LEARNING, EVOLUTION",
"author": "Zach Bateman",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/a7/6e/b896740a25a8592e252d37fdacd7cd04d139362b19be5013a77343f08eb0/evogression-0.11.0.tar.gz",
"platform": null,
"description": "# Evogression\r\n\r\nEvogression is a Python package providing an evolutionary algorithm to develop a regression function for a target parameter. An arbitrary number of input parameters can be used, and data samples need not have all parameters populated to be used in training the regression.\r\n\r\nAs of version 0.7.0, the core calculations are rewritten in Rust for much improved performance (~10x) compared to the previous Cython design.\r\n\r\n# Quickstart\r\n\r\n - Use pip to install Evogression\r\n ```\r\n pip install evogression\r\n ```\r\n\r\n - Format your input data as a list of dictionaries.\r\n - Run the following to generate a regression function and then output this function as a python module:\r\n ```\r\n import evogression\r\n\r\n evolution = evogression.Evolution('target_variable_key', data, num_creatures=10000, num_cycles=10)\r\n evolution.output_regression()\r\n ```\r\n - At this point, there will be a \"regression_function.py\" file within a newly-created \"regression_modules\" directory. The \"regression\" function within this Python module can be imported and used with a dictionary of inputs to generate an estimated output value.\r\n\r\n# Current Features\r\n\r\n - The goal of the evolution algorithm is to generate a group of \"creatures\" (each a unique regression function) which then compete to most accurately model the training data. Creatures are saved when they are better at modeling results than their peers, and a survival-of-the-fittest situation emerges. Creatures mutate individually and with other creatures to search for better solutions.\r\n\r\n - groups.py provides high-level approaches to regression by running multiple evolution groups.\r\n - Parameter pruning algorithm can determine the most useful attributes in a dataset and progressively discard the least useful data while determining a best fit equation for the target attribute.\r\n\r\n# Testing\r\n\r\n - Brute force generation of creatures successfully models linear and parabolic 2D data.\r\n\r\n<img src=\"tests/images/linear_regression_single_layer_brute_force_test.png\" width=\"550px\">\r\n\r\n\r\n - Evolution algorithm successfully models linear and parabolic 2D data.\r\n\r\n<img src=\"tests/images/parabola_regression_evolution_test.png\" width=\"550px\">\r\n\r\n\r\n - Evolution algorithm successfully uses a surface to approximate 3D data using two input attributes; this illustrates how multivariate relationships can be modeled. While the case of two inputs is visualized below, any number of input attributes can be used to build a regression function.\r\n\r\n<img src=\"tests/images/surface_regression_evolution_test_10seed.png\" width=\"550px\">\r\n\r\n\r\n - A \"Population\" can develop separate prediction models for data separated into different categories.\r\n\r\n <img src=\"tests/images/population_test.png\" width=\"550px\">\r\n\r\n\r\n\r\nLicense\r\n----\r\nMIT\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Evolutionary Regression",
"version": "0.11.0",
"project_urls": {
"Download": "https://github.com/zachbateman/evogression/archive/v_0.11.0.tar.gz",
"Homepage": "https://github.com/zachbateman/evogression.git"
},
"split_keywords": [
"regression",
" machine",
" learning",
" evolution"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "aedfcc232da1a40c3966338ec5d325d48eef5d0e2caffe3f5afa6150b8963f78",
"md5": "611b1e397bf7b75b749fa3cd89873e63",
"sha256": "656646245558f35ac5017eda9e507b8956b786b73f945d659899c9b42dc639d1"
},
"downloads": -1,
"filename": "evogression-0.11.0-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "611b1e397bf7b75b749fa3cd89873e63",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 459720,
"upload_time": "2024-09-27T05:06:46",
"upload_time_iso_8601": "2024-09-27T05:06:46.433787Z",
"url": "https://files.pythonhosted.org/packages/ae/df/cc232da1a40c3966338ec5d325d48eef5d0e2caffe3f5afa6150b8963f78/evogression-0.11.0-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b058bb3a6c08026f425df415e077b6c78847b0812b6523c2be6f17eb12142aa",
"md5": "d757c302f0a0ea678586e698c442e409",
"sha256": "6322e9c0b4bfd034d3141e6830fab028b93ac5008f7c869b2d2479dd6a23a885"
},
"downloads": -1,
"filename": "evogression-0.11.0-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "d757c302f0a0ea678586e698c442e409",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 459673,
"upload_time": "2024-09-27T05:06:48",
"upload_time_iso_8601": "2024-09-27T05:06:48.021574Z",
"url": "https://files.pythonhosted.org/packages/9b/05/8bb3a6c08026f425df415e077b6c78847b0812b6523c2be6f17eb12142aa/evogression-0.11.0-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ef6d1eb1c5d07b3c48f55b486aa2b908d6d31c28c91d6c3706ea47e6cad9dc62",
"md5": "92f90e637bd370db9c861d1e74bec27e",
"sha256": "fe206eb2a1eb91eee5cf12afc5d92fb71f64eb61a604b6fcb4f289319218b4f6"
},
"downloads": -1,
"filename": "evogression-0.11.0-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "92f90e637bd370db9c861d1e74bec27e",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": null,
"size": 459407,
"upload_time": "2024-09-27T05:06:49",
"upload_time_iso_8601": "2024-09-27T05:06:49.420707Z",
"url": "https://files.pythonhosted.org/packages/ef/6d/1eb1c5d07b3c48f55b486aa2b908d6d31c28c91d6c3706ea47e6cad9dc62/evogression-0.11.0-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a76eb896740a25a8592e252d37fdacd7cd04d139362b19be5013a77343f08eb0",
"md5": "ee6406f76a40b6c07baedfee454af7a2",
"sha256": "4822492f1f1c7ae5774a28bfcac14ff81995b260fb954fd9e32da4b4727cd953"
},
"downloads": -1,
"filename": "evogression-0.11.0.tar.gz",
"has_sig": false,
"md5_digest": "ee6406f76a40b6c07baedfee454af7a2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 146599,
"upload_time": "2024-09-27T05:06:51",
"upload_time_iso_8601": "2024-09-27T05:06:51.030148Z",
"url": "https://files.pythonhosted.org/packages/a7/6e/b896740a25a8592e252d37fdacd7cd04d139362b19be5013a77343f08eb0/evogression-0.11.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-27 05:06:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "zachbateman",
"github_project": "evogression",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "evogression"
}