{"id":21186479,"url":"https://github.com/thieu1995/metaperceptron","last_synced_at":"2025-07-10T01:31:18.795Z","repository":{"id":210369616,"uuid":"676088001","full_name":"thieu1995/MetaPerceptron","owner":"thieu1995","description":"MetaPerceptron: Unleashing the Power of Metaheuristic-optimized Multi-Layer Perceptron - A Python Library","archived":false,"fork":false,"pushed_at":"2024-11-04T07:29:33.000Z","size":338,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-04T07:46:45.991Z","etag":null,"topics":["adagrad-approach","adam-optimizer","adelta-optimizer","classification-models","genetic-algorithm","global-search","gradient-free-based-multi-layer-perceptron","metaheuristic-algorithms","metaheuristic-based-multi-layer-perceptron","metaheuristics","mlp","multi-layer-perceptron","nature-inspired-optimization","neural-network","particle-swarm-optimization","regression-models","sgd-optimizer","whale-optimization-algorithm"],"latest_commit_sha":null,"homepage":"https://metaperceptron.readthedocs.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thieu1995.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-08T12:04:48.000Z","updated_at":"2024-11-04T07:26:48.000Z","dependencies_parsed_at":"2023-12-02T10:25:25.889Z","dependency_job_id":"5c48befd-7bb8-4eff-b340-e84f08dd9b39","html_url":"https://github.com/thieu1995/MetaPerceptron","commit_stats":null,"previous_names":["thieu1995/metaperceptron"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FMetaPerceptron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FMetaPerceptron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FMetaPerceptron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FMetaPerceptron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thieu1995","download_url":"https://codeload.github.com/thieu1995/MetaPerceptron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225608369,"owners_count":17495899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["adagrad-approach","adam-optimizer","adelta-optimizer","classification-models","genetic-algorithm","global-search","gradient-free-based-multi-layer-perceptron","metaheuristic-algorithms","metaheuristic-based-multi-layer-perceptron","metaheuristics","mlp","multi-layer-perceptron","nature-inspired-optimization","neural-network","particle-swarm-optimization","regression-models","sgd-optimizer","whale-optimization-algorithm"],"created_at":"2024-11-20T18:23:55.748Z","updated_at":"2025-07-10T01:31:18.789Z","avatar_url":"https://github.com/thieu1995.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n\u003cimg style=\"width:100%;\" src=\"https://thieu1995.github.io/post/2023-08/metaperceptron1.png\" alt=\"MetaPerceptron\"/\u003e\n\u003c/p\u003e\n\n\n---\n\n[![GitHub release](https://img.shields.io/badge/release-2.2.0-yellow.svg)](https://github.com/thieu1995/MetaPerceptron/releases)\n[![Wheel](https://img.shields.io/pypi/wheel/gensim.svg)](https://pypi.python.org/pypi/metaperceptron) \n[![PyPI version](https://badge.fury.io/py/metaperceptron.svg)](https://badge.fury.io/py/metaperceptron)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/metaperceptron.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/metaperceptron.svg)\n[![Downloads](https://pepy.tech/badge/metaperceptron)](https://pepy.tech/project/metaperceptron)\n[![Tests \u0026 Publishes to PyPI](https://github.com/thieu1995/metaperceptron/actions/workflows/publish-package.yml/badge.svg)](https://github.com/thieu1995/metaperceptron/actions/workflows/publish-package.yml)\n[![Documentation Status](https://readthedocs.org/projects/metaperceptron/badge/?version=latest)](https://metaperceptron.readthedocs.io/en/latest/?badge=latest)\n[![Chat](https://img.shields.io/badge/Chat-on%20Telegram-blue)](https://t.me/+fRVCJGuGJg1mNDg1)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10251021.svg)](https://zenodo.org/doi/10.5281/zenodo.10251021)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n\n`MetaPerceptron` (Metaheuristic-optimized Multi-Layer Perceptron) is a powerful and extensible Python library that \nbrings the best of both worlds: metaheuristic optimization and deep learning via Multi-Layer Perceptron (MLP). \nWhether you're working with classic Gradient Descent techniques or state-of-the-art metaheuristic algorithms \nlike GA, PSO, WOA, DE, etc., `MetaPerceptron` has you covered. With `MetaPerceptron`, you can perform searches, \nfeature selection, and hyperparameter tuning using the features provided by the Scikit-Learn library.\n\n## 🚀 Features at a Glance\n\n- 🔧 **Estimators**: `MlpRegressor`, `MlpClassifier`, `MhaMlpRegressor`, `MhaMlpClassifier`\n- 📊 **Utilities**: `MhaMlpTuner`, `MhaMlpComparator`\n- 🧠 **Model Zoo**:\n  - 200+ Metaheuristic-trained MLP Regressors\n  - 200+ Metaheuristic-trained MLP Classifiers\n  - 12 Gradient Descent-trained MLP Regressors\n  - 12 Gradient Descent-trained MLP Classifiers\n- 📏 **67+ Performance Metrics** (47 for regression, 20 for classification)\n- ⚙️ **Support**: GPU support (for GD-based models), Scikit-learn compatible API\n- 📚 **Documentation**: https://metaperceptron.readthedocs.io\n- 🐍 **Python**: 3.8+\n- 📦 **Dependencies**: numpy, scipy, scikit-learn, pytorch, mealpy, pandas, permetrics\n\n\n## 📖 Citation\n\nIf MetaPerceptron supports your work, please consider citing the following:\n\n```bibtex\n@article{van2025metaperceptron,\n  title={MetaPerceptron: A Standardized Framework for Metaheuristic-Driven Multi-Layer Perceptron Optimization},\n  author={Van Thieu, Nguyen and Mirjalili, Seyedali and Garg, Harish and Hoang, Nguyen Thanh},\n  journal={Computer Standards \\\u0026 Interfaces},\n  pages={103977},\n  year={2025},\n  publisher={Elsevier},\n  doi={10.1016/j.csi.2025.103977},\n  url={https://doi.org/10.1016/j.csi.2025.103977}\n}\n\n@article{van2023mealpy,\n  title={MEALPY: An open-source library for latest meta-heuristic algorithms in Python},\n  author={Van Thieu, Nguyen and Mirjalili, Seyedali},\n  journal={Journal of Systems Architecture},\n  year={2023},\n  publisher={Elsevier},\n  doi={10.1016/j.sysarc.2023.102871}\n}\n\n@article{van2023groundwater,\n  title={Groundwater level modeling using Augmented Artificial Ecosystem Optimization},\n  author={Van Thieu, Nguyen and Barma, Surajit Deb and Van Lam, To and Kisi, Ozgur and Mahesha, Amai},\n  journal={Journal of Hydrology},\n  volume={617},\n  pages={129034},\n  year={2023},\n  publisher={Elsevier},\n  doi={10.1016/j.jhydrol.2022.129034}\n}\n```\n\n\n## 🧪 Quick Start\n\nInstall the latest version using pip:\n\n```bash\npip install metaperceptron\n```\n\nAfter that, check the version to ensure successful installation:\n\n```python\nimport metaperceptron\nprint(metaperceptron.__version__)\n```\n\n\n### ✅ Import core components\n\nHere is how you can import all provided classes from `MetaPerceptron`\n\n```python\nfrom metaperceptron import DataTransformer, Data\nfrom metaperceptron import MhaMlpRegressor, MhaMlpClassifier, MlpRegressor, MlpClassifier\nfrom metaperceptron import MhaMlpTuner, MhaMlpComparator\n```\n\n### 🔍 Example: Training an MLP Classifier with Genetic Algorithm\n\nIn this tutorial, we will use Genetic Algorithm to train Multi-Layer Perceptron network for classification task.\nFor more complex examples and use cases, please check the folder [examples](examples).\n\n```python\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\nfrom metaperceptron import DataTransformer, MhaMlpClassifier\n\n## Load the dataset\nX, y = load_iris(return_X_y=True)\n\n## Split train and test\nX_train, y_train, X_test, y_test = train_test_split(X, y, test_size=0.2)\n\n## Scale dataset with two methods: standard and minmax\ndt = DataTransformer(scaling_methods=(\"standard\", \"minmax\"))\nX_train_scaled = dt.fit_transform(X_train)\nX_test_scaled = dt.transform(X_test)\n\n## Define Genetic Algorithm-trained Multi-Layer Perceptron\nmodel = MhaMlpClassifier(hidden_layers=(50, 15), act_names=\"Tanh\", \n                         dropout_rates=None, act_output=None, \n                         optim=\"BaseGA\", optim_params={\"epoch\": 100, \"pop_size\": 20, \"name\": \"GA\"}, \n                         obj_name=\"F1S\", seed=42, verbose=True)\n## Train the model\nmodel.fit(X=X_train_scaled, y=y_train)\n\n## Test the model\ny_pred = model.predict(X_test)\nprint(y_pred)\n\n## Print the score\nprint(model.score(X_test_scaled, y_test))\n\n## Calculate some metrics\nprint(model.evaluate(y_true=y_test, y_pred=y_pred, list_metrics=[\"AS\", \"PS\", \"RS\", \"F2S\", \"CKS\", \"FBS\"]))\n```\n\n## 💬 Support\n\n- 📦 [Source Code](https://github.com/thieu1995/MetaPerceptron)\n- 📖 [Documentation](https://metaperceptron.readthedocs.io/)\n- ⬇️ [PyPI Releases](https://pypi.org/project/metaperceptron/)\n- ❗ [Report Issues](https://github.com/thieu1995/MetaPerceptron/issues)\n- 📝 [Changelog](https://github.com/thieu1995/MetaPerceptron/blob/master/ChangeLog.md)\n- 💬 [Chat Group](https://t.me/+fRVCJGuGJg1mNDg1)\n\n---\n\nDeveloped by: [Thieu](mailto:nguyenthieu2102@gmail.com?Subject=MetaPerceptron_QUESTIONS) @ 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieu1995%2Fmetaperceptron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthieu1995%2Fmetaperceptron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieu1995%2Fmetaperceptron/lists"}