{"id":41295757,"url":"https://github.com/thieu1995/waveletml","last_synced_at":"2026-01-23T04:12:54.423Z","repository":{"id":294085305,"uuid":"977963183","full_name":"thieu1995/WaveletML","owner":"thieu1995","description":"WaveletML: A Scalable and Extensible Wavelet Neural Network Framework","archived":false,"fork":false,"pushed_at":"2025-06-04T18:11:21.000Z","size":183,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-03T06:28:05.061Z","etag":null,"topics":["classification","genetic-algorithm","gpu-acceleration","gradient-descent","machine-learning","metaheuristic-algorithm","neural-network","particle-swarm-optimization","regression","wavelet-based-net","wavelet-layer","wavelet-neural-network","wavelet-transform","wavelets","whale-optimization-algorithm","wnn"],"latest_commit_sha":null,"homepage":"https://waveletml.readthedocs.io/","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,"zenodo":null}},"created_at":"2025-05-05T08:58:52.000Z","updated_at":"2025-09-20T10:40:08.000Z","dependencies_parsed_at":"2025-05-18T21:41:43.182Z","dependency_job_id":null,"html_url":"https://github.com/thieu1995/WaveletML","commit_stats":null,"previous_names":["thieu1995/waveletml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thieu1995/WaveletML","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FWaveletML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FWaveletML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FWaveletML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FWaveletML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thieu1995","download_url":"https://codeload.github.com/thieu1995/WaveletML/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thieu1995%2FWaveletML/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28679730,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T04:02:18.746Z","status":"ssl_error","status_checked_at":"2026-01-23T04:01:41.298Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["classification","genetic-algorithm","gpu-acceleration","gradient-descent","machine-learning","metaheuristic-algorithm","neural-network","particle-swarm-optimization","regression","wavelet-based-net","wavelet-layer","wavelet-neural-network","wavelet-transform","wavelets","whale-optimization-algorithm","wnn"],"created_at":"2026-01-23T04:12:52.623Z","updated_at":"2026-01-23T04:12:54.416Z","avatar_url":"https://github.com/thieu1995.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WaveletML: A Scalable and Extensible Wavelet Neural Network Framework\n\n[![GitHub release](https://img.shields.io/badge/release-0.2.0-yellow.svg)](https://github.com/thieu1995/WaveletML/releases)\n[![PyPI version](https://badge.fury.io/py/waveletml.svg)](https://badge.fury.io/py/waveletml)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/waveletml.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/waveletml.svg)\n[![Downloads](https://pepy.tech/badge/waveletml)](https://pepy.tech/project/waveletml)\n[![Tests \u0026 Publishes to PyPI](https://github.com/thieu1995/WaveletML/actions/workflows/publish-package.yml/badge.svg)](https://github.com/thieu1995/WaveletML/actions/workflows/publish-package.yml)\n[![Documentation Status](https://readthedocs.org/projects/waveletml/badge/?version=latest)](https://waveletml.readthedocs.io/en/latest/?badge=latest)\n[![Chat](https://img.shields.io/badge/Chat-on%20Telegram-blue)](https://t.me/+fRVCJGuGJg1mNDg1)\n[![DOI](https://img.shields.io/badge/DOI-10.6084%2Fm9.figshare.29095376-blue)](https://doi.org/10.6084/m9.figshare.29095376)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n---\n\n\n## 📌 Overview\n\n**WaveletML** is an open-source Python framework designed for building, training, and evaluating Wavelet \nNeural Networks (WNNs) tailored for supervised learning tasks such as regression and classification. Leveraging the \npower of PyTorch and the modularity of scikit-learn, WaveletML provides a unified, extensible, and scalable platform \nfor researchers and practitioners to explore wavelet-based neural architectures.\n\n## Features\n\n- ✅ Modular Wavelet Neural Network (WNN) architectures\n- ✅ Support for multiple wavelet functions (e.g., Morlet, Mexican Hat)\n- ✅ Support for multiple wavelet layers (e.g., Weighed Linear, Product, Summation, etc.)\n- ✅ Gradient Descent-based training via Pytorch\n- ✅ Metaheuristic Algorithm-based training via Mealpy\n- ✅ `scikit-learn`-compatible API with `BaseEstimator` support\n- ✅ Built-in support for both classification and regression tasks\n- ✅ Customizable activation functions, training parameters, and loss functions\n- ✅ Designed for scalability, enabling deployment on CPU or GPU environments.\n\nWhether you're prototyping WNN-based models or conducting advanced experimental research, **WaveletML** aims to bridge \nthe gap between theory and practical implementation in wavelet-based learning systems.\n\n## Model Types\n- `GdWnnClassifier`: Wavelet-based classifier using gradient-based training\n- `GdWnnRegressor`: Wavelet-based regressor using gradient-based training\n- `MhaWnnClassifier`: Uses metaheuristics (e.g., PSO, GA) for training\n- `MhaWnnRegressor`: Wavelet-based regressor with metaheuristic training\n\n\n## 📦 Installation\n\nInstall the latest version using pip:\n\n```bash\npip install waveletml\n```\n\nAfter that, check the version to ensure successful installation:\n\n```sh\n$ python\n\u003e\u003e\u003e import waveletml\n\u003e\u003e\u003e waveletml.__version__\n```\n\n## 🚀 Quick Start\n\n\n### Classification\n\nIn this example, we will use `Adam` optimizer to train Wavelet Weighted Linear Neural Network (WNN) for a classification task.\n\n```python\nfrom sklearn.datasets import load_iris\nfrom waveletml import Data, GdWnnClassifier\n\n\n## Load data object\nX, y = load_iris(return_X_y=True)\ndata = Data(X, y)\n\n## Split train and test\ndata.split_train_test(test_size=0.2, random_state=2, inplace=True, shuffle=True)\nprint(data.X_train.shape, data.X_test.shape)\n\n## Scaling dataset\ndata.X_train, scaler_X = data.scale(data.X_train, scaling_methods=(\"standard\", \"minmax\"))\ndata.X_test = scaler_X.transform(data.X_test)\n\ndata.y_train, scaler_y = data.encode_label(data.y_train)\ndata.y_test = scaler_y.transform(data.y_test)\n\nprint(type(data.X_train), type(data.y_train))\n\n## Create model\nmodel = GdWnnClassifier(size_hidden=10, wavelet_fn=\"morlet\", act_output=None,\n                        epochs=100, batch_size=16, optim=\"Adam\", optim_params=None,\n                        valid_rate=0.1, seed=42, verbose=True, device=None)\n## Train the model\nmodel.fit(X=data.X_train, y=data.y_train)\n\n## Test the model\ny_pred = model.predict(data.X_test)\nprint(y_pred)\nprint(model.predict_proba(data.X_test))\n\n## Calculate some metrics\nprint(model.evaluate(y_true=data.y_test, y_pred=y_pred, list_metrics=[\"F2S\", \"CKS\", \"FBS\", \"PS\", \"RS\", \"NPV\", \"F1S\"]))\n\n## Print model parameters\nfor k, v in model.network.named_parameters():\n    print(f\"{k}: {v.shape}, {v.data}\")\n```\n\n### Regression\n\nIn this example, we will use `Genetic Algorithm - GA` to train Wavelet Summation Neural Network (WNN) for a regression task.\n\n```python\nfrom sklearn.datasets import load_diabetes\nfrom waveletml import Data, MhaWnnRegressor, CustomWaveletSummationNetwork\n\n\n## Load data object\nX, y = load_diabetes(return_X_y=True)\ndata = Data(X, y)\n\n## Split train and test\ndata.split_train_test(test_size=0.2, random_state=2, inplace=True)\nprint(data.X_train.shape, data.X_test.shape)\n\n## Scaling dataset\ndata.X_train, scaler_X = data.scale(data.X_train, scaling_methods=(\"standard\", \"minmax\"))\ndata.X_test = scaler_X.transform(data.X_test)\n\ndata.y_train, scaler_y = data.scale(data.y_train, scaling_methods=(\"standard\", \"minmax\"))\ndata.y_test = scaler_y.transform(data.y_test.reshape(-1, 1))\n\nprint(type(data.X_train), type(data.y_train))\n\n## Create model\nmodel = MhaWnnRegressor(size_hidden=10, wavelet_fn=\"morlet\", act_output=None,\n                        optim=\"BaseGA\", optim_params={\"epoch\": 40, \"pop_size\": 20},\n                        obj_name=\"MSE\", seed=42, verbose=True, wnn_type=CustomWaveletSummationNetwork,\n                        lb=None, ub=None, mode='single', n_workers=None, termination=None)\n## Train the model\nmodel.fit(data.X_train, data.y_train)\n\n## Test the model\ny_pred = model.predict(data.X_test)\nprint(y_pred)\n\n## Calculate some metrics\nprint(model.evaluate(y_true=data.y_test, y_pred=y_pred, list_metrics=[\"R2\", \"NSE\", \"MAPE\", \"NNSE\"]))\n\n## Print model parameters\nfor k, v in model.network.named_parameters():\n    print(f\"{k}: {v.shape}, {v.data}\")\n```\n\nPlease read the [examples](/examples) folder for more use cases.\n\n\n## 📚 Documentation\n\nDocumentation is available at: 👉 https://waveletml.readthedocs.io\n\nYou can build the documentation locally:\n\n```shell\ncd docs\nmake html\n```\n\n## 🧪 Testing\nYou can run unit tests using:\n\n```shell\npytest tests/\n```\n\n## 🤝 Contributing\nWe welcome contributions to `WaveletML`! If you have suggestions, improvements, or bug fixes, feel free to fork \nthe repository, create a pull request, or open an issue.\n\n\n## 📄 License\nThis project is licensed under the GPLv3 License. See the LICENSE file for more details.\n\n\n## Citation Request\nPlease include these citations if you plan to use this library:\n\n```bibtex\n@software{thieu20250525WaveletML,\n  author       = {Nguyen Van Thieu},\n  title        = {WaveletML: A Scalable and Extensible Wavelet Neural Network Framework},\n  month        = June,\n  year         = 2025,\n  doi         = {10.6084/m9.figshare.29095376},\n  url          = {https://github.com/thieu1995/WaveletML}\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\n## Official Links \n\n* Official source code repo: https://github.com/thieu1995/WaveletML\n* Official document: https://waveletml.readthedocs.io/\n* Download releases: https://pypi.org/project/waveletml/\n* Issue tracker: https://github.com/thieu1995/WaveletML/issues\n* Notable changes log: https://github.com/thieu1995/WaveletML/blob/master/ChangeLog.md\n* Official chat group: https://t.me/+fRVCJGuGJg1mNDg1\n\n---\n\nDeveloped by: [Thieu](mailto:nguyenthieu2102@gmail.com?Subject=WaveletML_QUESTIONS) @ 2025\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieu1995%2Fwaveletml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthieu1995%2Fwaveletml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthieu1995%2Fwaveletml/lists"}