GrafoRVFL: A Gradient-Free Optimization Framework for Boosting Random Vector Functional Link Network
Project description
GrafoRVFL (GRAdient Free Optimized Random Vector Functional Link)
GrafoRVFL is an open-source library in Python that employs gradient-free optimization (GA, PSO, WOA, TLO, DE, ...) to optimize Random Vector Functional Link Networks. It is entirely implemented based on Numpy and fully compatible with the interfaces of the Scikit-Learn library. With GrafoRVFL, you can fine-tune the hyper-parameters of network in the network using gradient-free optimizers.
- Free software: GNU General Public License (GPL) V3 license
- Documentation: https://graforvfl.readthedocs.io
- Provided Estimator:
RvflRegressor
,RvflClassifier
,GfoRvflTuner
- Python versions: >= 3.8.x
- Dependencies: numpy, scipy, scikit-learn, pandas, mealpy, permetrics
Citation Request
-
Learn more about Random Vector Functional Link from this paper
-
Learn more about on how to use Gradient Free Optimization to fine-tune the hyper-parameter of RVFL networks from this paper
Please include these citations if you plan to use this library:
@software{nguyen_van_thieu_2023_10258280,
author = {Nguyen Van Thieu},
title = {GrafoRVFL: A Gradient-Free Optimization Framework for Boosting Random Vector Functional Link Network},
month = dec,
year = 2023,
publisher = {Zenodo},
doi = {10.5281/zenodo.10258280},
url = {https://github.com/thieu1995/GrafoRVFL}
}
@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}
}
@inproceedings{nguyen2019building,
title={Building resource auto-scaler with functional-link neural network and adaptive bacterial foraging optimization},
author={Nguyen, Thieu and Nguyen, Binh Minh and Nguyen, Giang},
booktitle={International Conference on Theory and Applications of Models of Computation},
pages={501--517},
year={2019},
organization={Springer}
}
@inproceedings{nguyen2018resource,
title={A resource usage prediction system using functional-link and genetic algorithm neural network for multivariate cloud metrics},
author={Nguyen, Thieu and Tran, Nhuan and Nguyen, Binh Minh and Nguyen, Giang},
booktitle={2018 IEEE 11th conference on service-oriented computing and applications (SOCA)},
pages={49--56},
year={2018},
organization={IEEE},
doi={10.1109/SOCA.2018.00014}
}
Installation
- Install the current PyPI release:
$ pip install graforvfl
After installation, you can check the installed version by:
$ python
>>> import graforvfl
>>> graforvfl.__version__
Example
Below is the example code of how to use Gradient Free Optimization to tune hyper-parameter of RVFL network. The more complicated cases in the folder: examples. You can also read the documentation for more detailed installation instructions, explanations, and examples.
from sklearn.datasets import load_breast_cancer
from mealpy import StringVar, IntegerVar
from graforvfl import Data, GfoRvflTuner
## Load data object
X, y = load_breast_cancer(return_X_y=True)
data = Data(X, y)
## Split train and test
data.split_train_test(test_size=0.2, random_state=2, inplace=True)
print(data.X_train.shape, data.X_test.shape)
## Scaling dataset
data.X_train, scaler_X = data.scale(data.X_train, scaling_methods=("standard", "minmax"))
data.X_test = scaler_X.transform(data.X_test)
data.y_train, scaler_y = data.encode_label(data.y_train)
data.y_test = scaler_y.transform(data.y_test)
# Design the boundary (parameters)
my_bounds = [
IntegerVar(lb=2, ub=1000, name="size_hidden"),
StringVar(valid_sets=("none", "relu", "leaky_relu", "celu", "prelu", "gelu",
"elu", "selu", "rrelu", "tanh", "sigmoid"), name="act_name"),
StringVar(valid_sets=("orthogonal", "he_uniform", "he_normal", "glorot_uniform", "glorot_normal",
"lecun_uniform", "lecun_normal", "random_uniform", "random_normal"), name="weight_initializer")
]
opt_paras = {"name": "WOA", "epoch": 10, "pop_size": 20}
model = GfoRvflTuner(problem_type="classification", bounds=my_bounds, cv=3, scoring="AS",
optimizer="OriginalWOA", optimizer_paras=opt_paras, verbose=True, seed=42)
model.fit(data.X_train, data.y_train)
print(model.best_params)
print(model.best_estimator)
print(model.best_estimator.scores(data.X_test, data.y_test, list_metrics=("PS", "RS", "NPV", "F1S", "F2S")))
Official channels
- Official source code repository
- Official document
- Download releases
- Issue tracker
- Notable changes log
- Official discussion group
Developed by: Thieu @ 2023
Project details
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 graforvfl-1.2.0.tar.gz
.
File metadata
- Download URL: graforvfl-1.2.0.tar.gz
- Upload date:
- Size: 37.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f8d89826b939c8edbdcc04cf9581a1f7b95a89d5a8e0f3d2c7dde91303c9b96 |
|
MD5 | e8cd5d2840dcd636c187c3db61d31734 |
|
BLAKE2b-256 | 1db317f7f6215033d5ed407a136c544ea1242148b9cbe61e10f4e325de0a4b3f |
File details
Details for the file graforvfl-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: graforvfl-1.2.0-py3-none-any.whl
- Upload date:
- Size: 37.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc27a62b14e47ea041131175f53a43cf92ac700e5e7ba3c00f01a1683dc0da46 |
|
MD5 | 34d4b343e0a02fbd93ab6e41ade00486 |
|
BLAKE2b-256 | b6cdecb15832cf87137dd90e5db9362fe18addd9a39fd5c5f3591006b9a39ffc |