Giter Site home page Giter Site logo

thieu1995 / evorbf Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 4.08 MB

EvoRBF: Evolving Radial Basis Function Network by Intelligent Nature-inspired Algorithms

Home Page: https://evorbf.readthedocs.org

License: GNU General Public License v3.0

Python 100.00%
classification evolutionary-algorithms genetic-algorithm global-search gradient-free-optimization local-search machine-learning mealpy metaheuristic-algorithms nature-inspired-algorithms

evorbf's Introduction

EvoRBF


GitHub release Wheel PyPI version PyPI - Python Version PyPI - Status PyPI - Downloads Downloads Tests & Publishes to PyPI GitHub Release Date Documentation Status Chat GitHub contributors GitTutorial DOI License: GPL v3

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

$ 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)

evorbf's People

Contributors

thieu1995 avatar thieupu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mberkanbicer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.