Welcome to XANFIS’s documentation!¶
X-ANFIS (An Extensible and Cross-Learning ANFIS Framework for Machine Learning Tasks) is a Python framework designed for Adaptive Neuro-Fuzzy Inference Systems with high customizability and modern ML integration. X-ANFIS is fully modular, written in PyTorch, and compatible with Scikit-Learn pipelines. It supports a wide range of learning strategies, including gradient descent, least squares estimation, and even bio-inspired methods.
Free software: GNU General Public License (GPL) V3 license
Provided Estimators: AnfisRegressor, AnfisClassifier, GdAnfisRegressor, GdAnfisClassifier, BioAnfisRegressor, BioAnfisClassifier
Supported Membership Functions: Gaussian, Bell, Triangular, Custom
Supported Learning Strategies: Hybrid (GD + LSE), Gradient-only, Bio-inspired (Bio + LSE)
Supported performance metrics: >= 67 (47 regressions and 20 classifications)
Supported objective functions (as fitness functions or loss functions): >= 67 (47 regressions and 20 classifications)
Documentation: https://x-anfis.readthedocs.io
Python versions: >= 3.8.x
Dependencies: numpy, scipy, scikit-learn, pandas, mealpy, permetrics, torch
The OOP structure idea¶
The structure and idea of this library is followed:
CustomANFIS (torch.nn.Module)
BaseAnfis (Scikit-learn BaseEstimator)
├── BaseClassicAnfis
│ ├── AnfisRegressor
│ └── AnfisClassifier
├── BaseGdAnfis
│ ├── GdAnfisRegressor
│ └── GdAnfisClassifier
└── BaseBioAnfis
├── BioAnfisRegressor
└── BioAnfisClassifier
.CustomANFIS class: Define general Pytorch model
.BaseAnfis class: Inherit BaseEstimator from Scikit-Learn
.BaseClassicAnfis: Inherit BaseAnfis class, this is classical (traditional) ANFIS model
+ Purpose: Gradient-based training for membership parameters, and Pseudo-inverse and Ridge regresison for consequent (output weights)
+ AnfisRegressor: Inherit BaseClassicAnfis and RegressorMixin classes, ANFIS wrapper for regression tasks
+ AnfisClassifier: Inherit BaseClassicAnfis and ClassifierMixin classes, ANFIS wrapper for classification tasks
.BaseGdAnfis: Inherit BaseAnfis class, this is gradient-based ANFIS model
+ Purpose: Gradient-based training for both membership parameters and consequent (output weights)
+ GdAnfisRegressor: Inherit BaseGdAnfis and RegressorMixin classes, ANFIS wrapper for regression tasks
+ GdAnfisClassifier: Inherit BaseGdAnfis and ClassifierMixin classes, ANFIS wrapper for classification tasks
.BaseBioAnfis: Inherit BaseAnfis class, this is bio-inspired ANFIS model
+ Purpose: Bio-inspired training for both membership parameters and Psedo-inverse and Ridge regresison for consequent (output weights)
+ BioAnfisRegressor: Inherit BaseBioAnfis and RegressorMixin classes, ANFIS wrapper for regression tasks
+ BioAnfisClassifier: Inherit BaseBioAnfis and ClassifierMixin classes, ANFIS wrapper for classification tasks
Quick Start:
Models API:
- xanfis package
- xanfis.helpers package
- xanfis.models package
Support: