{"id":37067183,"url":"https://github.com/sherstpasha/thefittest","last_synced_at":"2026-01-14T07:53:09.295Z","repository":{"id":63456495,"uuid":"567695954","full_name":"sherstpasha/thefittest","owner":"sherstpasha","description":"Implementation of data mining methods that use evolutionary algorithms","archived":false,"fork":false,"pushed_at":"2025-12-18T17:06:11.000Z","size":52977,"stargazers_count":64,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-21T06:22:52.082Z","etag":null,"topics":["algorithm","differential-evolution","evolutionary-algorithms","genetic-algorithm","genetic-programming","heuristic-search","optimization","optimization-algorithms"],"latest_commit_sha":null,"homepage":"https://sherstpasha.github.io/thefittest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sherstpasha.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-18T11:08:47.000Z","updated_at":"2025-12-18T17:06:16.000Z","dependencies_parsed_at":"2023-12-14T14:25:35.482Z","dependency_job_id":"310afaab-fe5f-4e85-8ffd-5d890c93091a","html_url":"https://github.com/sherstpasha/thefittest","commit_stats":{"total_commits":177,"total_committers":2,"mean_commits":88.5,"dds":0.2655367231638418,"last_synced_commit":"1addeb7e77ba4993937ab1c2d15833cdffb70da9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sherstpasha/thefittest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherstpasha%2Fthefittest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherstpasha%2Fthefittest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherstpasha%2Fthefittest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherstpasha%2Fthefittest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sherstpasha","download_url":"https://codeload.github.com/sherstpasha/thefittest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sherstpasha%2Fthefittest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","differential-evolution","evolutionary-algorithms","genetic-algorithm","genetic-programming","heuristic-search","optimization","optimization-algorithms"],"created_at":"2026-01-14T07:53:08.554Z","updated_at":"2026-01-14T07:53:09.288Z","avatar_url":"https://github.com/sherstpasha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/pypi/v/thefittest?label=PyPI%20-%20Package%20version\n    :target: https://pypi.org/project/thefittest/\n    :alt: PyPI - Package version\n.. image:: https://static.pepy.tech/badge/thefittest\n    :target: https://pepy.tech/project/thefittest\n    :alt: Downloads\n.. image:: https://komarev.com/ghpvc/?username=thefittest\n    :alt: Profile views\n.. image:: https://codecov.io/github/sherstpasha/thefittest/coverage.svg?branch=master\n    :alt: codecov.io\n.. image:: https://app.codacy.com/project/badge/Grade/4c47b6de61c4422180529bbc360262c4\n    :target: https://app.codacy.com/gh/sherstpasha/thefittest/dashboard?utm_source=gh\u0026utm_medium=referral\u0026utm_content=\u0026utm_campaign=Badge_grade\n    :alt: Codacy Badge\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Code style: black\n.. image:: https://readthedocs.com/projects/sherstpasha-pavel/badge/?version=latest\u0026token=71adf5d63b55f0def96b09e1ce4c60f8d57cbdaed7db777117f34e4718d5a1ea\n    :target: https://sherstpasha-pavel.readthedocs-hosted.com/ru/latest/?badge=latest\n    :alt: Documentation Status\n    \n.. image:: docs/logos/logo1.png\n   :align: center\n\n``thefittest`` is an open-source library designed for the efficient application of classical evolutionary algorithms and their effective modifications in optimization and machine learning. Our project aims to provide performance, accessibility, and ease of use, opening up the world of advanced evolutionary methods to you.\n\nFeatures of ``thefittest``\n--------------------------\n\n**Performance**\n  Our library is developed using advanced coding practices and delivers high performance through integration with `NumPy \u003chttps://numpy.org/\u003e`_, `Scipy \u003chttps://scipy.org/\u003e`_, `Numba \u003chttps://numba.pydata.org/\u003e`_, and `scikit-learn \u003chttps://scikit-learn.org/\u003e`_.\n\n**Versatility**\n  ``thefittest`` offers a wide range of classical evolutionary algorithms and effective modifications, making it the ideal choice for a variety of optimization and machine learning tasks.\n\n**Integration with scikit-learn**\n  Easily integrate machine learning methods from ``thefittest`` with `scikit-learn \u003chttps://scikit-learn.org/\u003e`_ tools, creating comprehensive and versatile solutions for evolutionary optimization and model training tasks.\n\nInstallation\n------------\n\n**Basic installation** (for evolutionary algorithms and symbolic regression):\n\n.. code-block:: bash\n\n    pip install thefittest\n\nThis installation includes all evolutionary optimizers (GA, DE, SHADE, etc.) and symbolic regression with GP.\n\n**Full installation with neural networks** (requires GPU with CUDA):\n\nFirst, install PyTorch with CUDA support from the official website: https://pytorch.org/get-started/locally/\n\nFor example, for CUDA 12.4:\n\n.. code-block:: bash\n\n    pip3 install torch --index-url https://download.pytorch.org/whl/cu124\n\nThen install thefittest:\n\n.. code-block:: bash\n\n    pip install thefittest\n\nThis enables neural network models (``MLPEAClassifier``, ``MLPEARegressor``, ``GeneticProgrammingNeuralNetClassifier``, ``GeneticProgrammingNeuralNetRegressor``) with GPU acceleration.\n\n\nUsage Example\n-------------\n\nThe following example demonstrates how to use ``thefittest`` library with the SHADE optimizer to minimize a custom objective function. This quick start example showcases the main components needed to set up and run an optimization.\n\n.. code-block:: python\n\n    from thefittest.optimizers import SHADE\n\n    # Define the objective function to minimize\n    def custom_problem(x):\n        return (5 - x[:, 0])**2 + (12 - x[:, 1])**2\n\n    # Initialize the SHADE optimizer with custom parameters\n    optimizer = SHADE(\n        fitness_function=custom_problem,\n        iters=25,\n        pop_size=10,\n        left_border=-100,\n        right_border=100,\n        num_variables=2,\n        show_progress_each=10,\n        minimization=True,\n    )\n\n    # Run the optimization\n    optimizer.fit()\n\n    # Retrieve and print the best solution found\n    fittest = optimizer.get_fittest()\n    print('The fittest individ:', fittest['phenotype'])\n    print('with fitness', fittest['fitness'])\n\nMachine Learning Example\n------------------------\n\nThis example demonstrates how to train a machine learning model on the Iris dataset using ``thefittest`` library's ``MLPEAClassifier`` with the SHAGA evolutionary optimizer.\n\n.. code-block:: python\n\n    from thefittest.optimizers import SHAGA\n    from thefittest.benchmarks import IrisDataset\n    from thefittest.classifiers import MLPEAClassifier\n\n    from sklearn.model_selection import train_test_split\n    from sklearn.preprocessing import minmax_scale\n    from sklearn.metrics import confusion_matrix, f1_score\n\n    # Load the Iris dataset\n    data = IrisDataset()\n    X = data.get_X()\n    y = data.get_y()\n\n    # Scale features to the [0, 1] range\n    X_scaled = minmax_scale(X)\n\n    # Split the data into training and test sets\n    X_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.1)\n\n    # Initialize the MLPEAClassifier with SHAGA as the optimizer\n    model = MLPEAClassifier(\n        n_iter=500,\n        pop_size=500,\n        hidden_layers=[5, 5],\n        weights_optimizer=SHAGA,\n        weights_optimizer_args={\"show_progress_each\": 10}\n    )\n\n    # Train the model\n    model.fit(X_train, y_train)\n    \n    # Make predictions on the test set\n    predict = model.predict(X_test)\n\n    # Evaluate the model\n    print(\"confusion_matrix: \\n\", confusion_matrix(y_test, predict))\n    print(\"f1_score: \\n\", f1_score(y_test, predict, average=\"macro\"))\n\nDependencies\n------------\n\n``thefittest`` requires the following packages (installed automatically with ``pip install thefittest``):\n\n- `Python (\u003e=3.7,\u003c=3.13) \u003chttps://www.python.org/\u003e`_;\n- `numpy (\u003e=1.26) \u003chttps://numpy.org/\u003e`_;\n- `numba (\u003e=0.60) \u003chttps://numba.pydata.org/\u003e`_;\n- `scipy \u003chttps://scipy.org/\u003e`_;\n- `scikit-learn (\u003e=1.4) \u003chttps://scikit-learn.org/\u003e`_;\n- `joblib (\u003e=1.3.0) \u003chttps://joblib.readthedocs.io/\u003e`_.\n\nOptional dependencies\n---------------------\n\nSome extra packages can be installed manually if needed:\n\n- `networkx \u003chttps://networkx.org/\u003e`_ — required for visualization methods that work with objects such as ``Net`` and ``Tree``;\n- `torch (\u003e=2.0) \u003chttps://pytorch.org/\u003e`_ with **CUDA** support — required for neural network models (``MLPEAClassifier``, ``MLPEARegressor``, ``GeneticProgrammingNeuralNetClassifier``, ``GeneticProgrammingNeuralNetRegressor``). Install from https://pytorch.org/get-started/locally/\n\n\n``thefittest`` contains methods\n-------------------------------\n\n- **Genetic algorithm** (Holland, J. H. (1992). Genetic algorithms. Scientific American, 267(1), 66-72):\n\n  - **Self-configuring genetic algorithm** (`Semenkin, E.S., Semenkina, M.E. Self-configuring Genetic Algorithm with Modified Uniform Crossover Operator. LNCS, 7331, 2012, pp. 414-421. \u003chttps://doi.org/10.1007/978-3-642-30976-2_50\u003e`_);\n  - **SHAGA** (`Stanovov, Vladimir \u0026 Akhmedova, Shakhnaz \u0026 Semenkin, Eugene. (2019). Genetic Algorithm with Success History based Parameter Adaptation. 180-187. \u003chttp://dx.doi.org/10.5220/0008071201800187\u003e`_);\n  - **PDPGA** (`Niehaus, J., Banzhaf, W. (2001); Adaption of Operator Probabilities in Genetic Programming. In: Miller, J., Tomassini, M., Lanzi, P.L., Ryan, C., Tettamanzi, A.G.B., Langdon, W.B. (eds) Genetic Programming. EuroGP 2001. Lecture Notes in Computer Science, vol 2038. Springer, Berlin, Heidelberg. \u003chttps://doi.org/10.1007/3-540-45355-5_26\u003e`_).\n\n- **Differential evolution** (Storn, Rainer \u0026 Price, Kenneth. (1995). Differential Evolution: A Simple and Efficient Adaptive Scheme for Global Optimization Over Continuous Spaces. Journal of Global Optimization. 23)\n\n  - **jDE** (`Brest, Janez \u0026 Greiner, Sao \u0026 Bošković, Borko \u0026 Mernik, Marjan \u0026 Zumer, Viljem. (2007). Self-Adapting Control Parameters in Differential Evolution: A Comparative 13. 945 - 958. \u003chttp://dx.doi.org/10.1109/TEVC.2009.2014613\u003e`_);\n  - **SHADE** (`Tanabe, Ryoji \u0026 Fukunaga, Alex. (2013). Success-history based parameter adaptation for Differential Evolution. 2013 IEEE Congress on Evolutionary Computation, CEC 2013. 71-78. \u003chttps://doi.org/10.1109/CEC.2013.6557555\u003e`_).\n\n- **Genetic programming** (Koza, John R.. “Genetic programming - on the programming of computers by means of natural selection.” Complex Adaptive Systems (1993)):\n\n  - **Self-configuring genetic programming** (`Semenkin, Eugene \u0026 Semenkina, Maria. (2012). Self-configuring genetic programming algorithm with modified uniform crossover. 1-6. \u003chttp://dx.doi.org/10.1109/CEC.2012.6256587\u003e`_).\n  - **PDPGP** (`Niehaus, J., Banzhaf, W. (2001); Adaption of Operator Probabilities in Genetic Programming. In: Miller, J., Tomassini, M., Lanzi, P.L., Ryan, C., Tettamanzi, A.G.B., Langdon, W.B. (eds) Genetic Programming. EuroGP 2001. Lecture Notes in Computer Science, vol 2038. Springer, Berlin, Heidelberg. \u003chttps://doi.org/10.1007/3-540-45355-5_26\u003e`_).\n\n- **Genetic programming of neural networks (GPNN)** (`Lipinsky L., Semenkin E., Bulletin of the Siberian State Aerospace University., 3(10), 22-26 (2006). In Russian`_);\n- **Multilayer perceptron trained by evolutionary algorithms** (`Cotta, Carlos \u0026 Alba, Enrique \u0026 Sagarna, R. \u0026 Larranaga, Pedro. (2002). Adjusting Weights in Artificial Neural Networks using Evolutionary Algorithms. \u003chttp://dx.doi.org/10.1007/978-1-4615-1539-5_18\u003e`_);\n\nBenchmarks\n----------\n\n- **CEC2005** (`Suganthan, Ponnuthurai \u0026 Hansen, Nikolaus \u0026 Liang, Jing \u0026 Deb, Kalyan \u0026 Chen, Ying-ping \u0026 Auger, Anne \u0026 Tiwari, Santosh. (2005). Problem Definitions and Evaluation Criteria for the CEC 2005 Special Session on Real-Parameter Optimization. Natural Computing. 341-357`_);\n- **Symbolicregression17. 17 test regression problem from the paper** (`Semenkin, Eugene \u0026 Semenkina, Maria. (2012). Self-configuring genetic programming algorithm with modified uniform crossover. 1-6. \u003chttp://dx.doi.org/10.1109/CEC.2012.6256587\u003e`_).\n- **Iris** (`Fisher,R. A.. (1988). Iris. UCI Machine Learning Repository. \u003chttps://doi.org/10.24432/C56C76\u003e`_);\n- **Wine** (`Aeberhard,Stefan and Forina,M.. (1991). Wine. UCI Machine Learning Repository. \u003chttps://doi.org/10.24432/C5PC7J\u003e`_);\n- **Breast Cancer Wisconsin (Diagnostic)** (`Wolberg,William, Mangasarian,Olvi, Street,Nick, and Street,W.. (1995). Breast Cancer Wisconsin (Diagnostic). UCI Machine Learning Repository. \u003chttps://doi.org/10.24432/C5DW2B\u003e`_);\n- **Optical Recognition of Handwritten Digits** (`Alpaydin,E. and Kaynak,C.. (1998). Optical Recognition of Handwritten Digits. UCI Machine Learning Repository. \u003chttps://doi.org/10.24432/C50P49\u003e`_);\n\nExamples\n--------\n\nNotebooks on how to use ``thefittest``:\n\n- `Solving Binary and Real-Valued Optimization Problems with Genetic Algorithms; \u003chttps://github.com/sherstpasha/thefittest-notebooks/blob/main/genetic_algorithm_binary_rastrigin_custom_problems.ipynb\u003e`_\n- `Solving Real-Valued Optimization Problems with Differential Evolution; \u003chttps://github.com/sherstpasha/thefittest-notebooks/blob/main/differential_evolution_griewank_custom_problems.ipynb\u003e`_\n- `Solving Symbolic Regression Problems Using Genetic Programming Algorithms; \u003chttps://github.com/sherstpasha/thefittest-notebooks/blob/main/genetic_programming_symbolic_regression_problem.ipynb\u003e`_\n- `Training Neural Networks Using Evolutionary Algorithms for Regression and Classification Problems; \u003chttps://github.com/sherstpasha/thefittest-notebooks/blob/main/mlpea_regression_classification_problem.ipynb\u003e`_\n- `Optimizing Neural Network Structure Using Genetic Programming; \u003chttps://github.com/sherstpasha/thefittest-notebooks/blob/main/gpnn_regression_classification_problems.ipynb\u003e`_\n\nIf some notebooks are too big to display, you can use `NBviewer \u003chttps://nbviewer.org/\u003e`_.\n\nKaggle Notebooks\n----------------\n\n- `Can Evolution Guide Us to Better Machine Learning? \u003chttps://www.kaggle.com/code/pashasherst/can-evolution-guide-us-to-better-machine-learning\u003e`_\n\nArticles\n--------\n\nPublications where ``thefittest`` has been used:\n\n- *Thefittest: evolutionary machine learning in Python*, January 2024, ITM Web of Conferences 59.\n  DOI: 10.1051/itmconf/20245902020. Licensed under CC BY 4.0. Authored by Pavel Sherstnev.\n  Available at: https://doi.org/10.1051/itmconf/20245902020\n\nAwards and Presentations\n-------------------------\n\n- **1st place**, Samsung Innovation Campus (IT Academy), *Artificial Intelligence* track, October 2024. `Read more \u003chttps://news.samsung.com/ru/объявлены-итоги-ежегодного-межвузов\u003e`_;  \n- **Best PhD Student Paper** at the 12th International Workshop on Mathematical Models and their Applications (IWMMA'2023) for the paper \"Thefittest: Evolutionary Machine Learning in Python\" by Pavel Sherstnev. `Watch presentation \u003chttps://youtu.be/R46b1tt5qUo?si=ZxGIcX2-sWJEWCbt\u0026t=4550\u003e`_;  \n- **Tutorial** Presenter at the 13th International Workshop on Mathematical Models and their Applications (IWMMA'2024) with the tutorial titled \"Thefittest Library: Evolutionary Algorithms and Automation of Machine Learning Models Design in Python\". `Watch tutorial \u003chttps://www.youtube.com/watch?v=PtDahwMstuw\u003e`_;  \n- **2nd place**, Youth IT Project Competition \"Soft-Parade 2025\". `More details \u003chttps://www.soft-parade.ru/archive\u003e`_\n- **2nd place**, GitVerse, Cloud.ru and Habr Open Source Grant Program \"Code Without Borders\" 2025. `More details \u003chttps://gitverse.ru/blog/articles/open-source/1172-pozdravlyaem-pobeditelej-grantovoj-programmy-kod-bez-granic\u003e`_\n- **International University Award \"Gravitation\" 2025** in the category *\"Algorithms and Software Solutions in AI and Big Data\"*, awarded by the Presidential Academy, Tomsk State University, and the Association *\"University Consortium of Big Data Researchers\"*. `More details \u003chttps://gravitation.ai/2025\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherstpasha%2Fthefittest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherstpasha%2Fthefittest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherstpasha%2Fthefittest/lists"}