EvoRBF: Evolving Radial Basis Function Network by Intelligent Nature-inspired Algorithms
Project description
EvoRBF is a Python library that implements a framework
for training Radial Basis Function (RBF) networks using Intelligence Nature-inspired Algorithms (INAs)
. It provides a
comparable alternative to the traditional RBF network and is compatible with the Scikit-Learn library. With EvoRBF, you can
perform searches and hyperparameter tuning using the functionalities provided by the Scikit-Learn library.
EvoRBF | Evolving Radial Basis Function Network |
---|---|
Free software | GNU General Public License (GPL) V3 license |
Provided Estimator | RbfRegressor, RbfClassifier, InaRbfRegressor, InaRbfClassifier, InaRbfTuner |
Provided ML models | > 400 Models |
Supported metrics | >= 67 (47 regressions and 20 classifications) |
Supported loss functions | >= 61 (45 regressions and 16 classifications) |
Documentation | https://evorbf.readthedocs.io |
Python versions | >= 3.8.x |
Dependencies | numpy, scipy, scikit-learn, pandas, mealpy, permetrics |
Citation Request
If you want to understand how Intelligence Nature-inspired Algorithms is applied to Radial Basis Function Network, you need to read the paper titled "Application of artificial intelligence in estimating mining capital expenditure using radial basis function neural network optimized by metaheuristic algorithms". The paper can be accessed at the following this link
@software{thieu_2024_11136008,
author = {Nguyen Van Thieu},
title = {EvoRBF: Evolving Radial Basis Function Network by Intelligent Nature-inspired Algorithms},
month = may,
year = 2024,
publisher = {Zenodo},
doi = {10.5281/zenodo.11136007},
url = {https://doi.org/10.5281/zenodo.11136007}
}
@article{van2023mealpy,
title={MEALPY: An open-source library for latest meta-heuristic algorithms in Python},
author={Van Thieu, Nguyen and Mirjalili, Seyedali},
journal={Journal of Systems Architecture},
year={2023},
publisher={Elsevier},
doi={10.1016/j.sysarc.2023.102871}
}
Usage
- Install the current PyPI release:
$ pip install evorbf
After installation, you can check EvoRBF version:
$ python
>>> import evorbf
>>> evorbf.__version__
In this example below, we will use Whale Optimization Algorithm to optimize the sigmas
(in non-linear Gaussian
kernel) and weights
(of hidden-output layer) in RBF network (WOA-RBF model) for Diabetes prediction problem.
import numpy as np
from evorbf import Data, InaRbfRegressor
from sklearn.datasets import load_diabetes
## Load data object
# total samples = 442, total features = 10
X, y = load_diabetes(return_X_y=True)
data = Data(X, y)
## Split train and test
data.split_train_test(test_size=0.2, random_state=2)
print(data.X_train.shape, data.X_test.shape)
## Scaling dataset
data.X_train, scaler_X = data.scale(data.X_train, scaling_methods=("standard"))
data.X_test = scaler_X.transform(data.X_test)
data.y_train, scaler_y = data.scale(data.y_train, scaling_methods=("standard", ))
data.y_test = scaler_y.transform(np.reshape(data.y_test, (-1, 1)))
## Create model
opt_paras = {"name": "WOA", "epoch": 500, "pop_size": 20}
model = InaRbfRegressor(size_hidden=25, center_finder="kmean", regularization=False, lamda=0.5, obj_name="MSE",
optimizer="BaseGA", optimizer_paras=opt_paras, verbose=True, seed=42)
## Train the model
model.fit(data.X_train, data.y_train, lb=-1., ub=2.)
## Test the model
y_pred = model.predict(data.X_test)
print(model.optimizer.g_best.solution)
## Calculate some metrics
print(model.score(X=data.X_test, y=data.y_test, method="RMSE"))
print(model.scores(X=data.X_test, y=data.y_test, list_methods=["R2", "R", "KGE", "MAPE"]))
print(model.evaluate(y_true=data.y_test, y_pred=y_pred, list_metrics=["MSE", "RMSE", "R2S", "NSE", "KGE", "MAPE"]))
Please go check out the examples folder. You'll be surprised by what this library can do for your problem. You can also read the documentation for more detailed installation instructions, explanations, and examples.
Official Links (Get support for questions and answers)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file evorbf-1.0.0.tar.gz
.
File metadata
- Download URL: evorbf-1.0.0.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a94c29b23d97e900ad4a5f4b7f6a5f4211f8618ea27f33efa894d12767b682 |
|
MD5 | e31a6ec4a7a710b002774383aa77ada0 |
|
BLAKE2b-256 | ec22760e70f2786d9e67a0c90be579716c1ca670ed7b17cc061c970654d3cccd |
File details
Details for the file evorbf-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: evorbf-1.0.0-py3-none-any.whl
- Upload date:
- Size: 37.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86d11b9c4dfb6328fe8d4f9e1651a84138aa154e6e63f53bd65fbaddd0488de2 |
|
MD5 | 33e16fa2aaf6074cd3ab3ddac83aa870 |
|
BLAKE2b-256 | c2f81c7b102c98ead794b5f819e8e1b36b27e5203789b8be8149fe9e35a69762 |