Metadata-Version: 2.4
Name: highfis
Version: 0.7.0
Summary: highFIS is a comprehensive Python package for training and evaluating high-dimensional TSK fuzzy systems, built on PyTorch and compatible with the scikit-learn API.
Project-URL: Homepage, https://github.com/dcruzf/highFIS
Project-URL: Documentation, https://dcruzf.github.io/highFIS/
Project-URL: Source, https://github.com/dcruzf/highFIS
Project-URL: Tracker, https://github.com/dcruzf/highFIS/issues
Project-URL: DOI, https://doi.org/10.5281/zenodo.19489225
Author-email: Daniel França <daniel@ci.ufpb.br>
License: GPLv3
License-File: LICENSE
Keywords: TSK,explainable ai,fuzzy logic,machine learning,neuro-fuzzy
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.11
Requires-Dist: numpy<3.0,>=1.24.1
Requires-Dist: scikit-learn>=1.7.2
Requires-Dist: torch>=2.3
Description-Content-Type: text/markdown

# highFIS

[![CI](https://github.com/dcruzf/highFIS/actions/workflows/ci.yaml/badge.svg)](https://github.com/dcruzf/highFIS/actions/workflows/ci.yaml)
[![Documentation](https://github.com/dcruzf/highFIS/actions/workflows/docs.yml/badge.svg)](https://github.com/dcruzf/highFIS/actions/workflows/docs.yml)
[![DOI](https://img.shields.io/badge/doi-10.5281%2Fzenodo.19489225-%2333CA56?logo=DOI&logoColor=white)](https://doi.org/10.5281/zenodo.19489225)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/highfis)](https://pypi.org/project/highfis/)
[![PyPI - Version](https://img.shields.io/pypi/v/highfis?color=%2333CA56)](https://pypi.org/project/highfis/)
[![PyPI - License](https://img.shields.io/pypi/l/highfis?color=%2333CA56)](https://raw.githubusercontent.com/dcruzf/highFIS/refs/heads/main/LICENSE)

highFIS is a PyTorch-based framework for high-dimensional Takagi–Sugeno–Kang
(TSK) fuzzy systems. It brings differentiable fuzzy inference, numerical
stability, and sklearn-compatible estimators to both classification and
regression workflows. It also includes DGTSK dynamic-gating models for
feature and rule selection in high-dimensional fuzzy systems.

## 🚀 Quick Start

Install from PyPI:

```bash
pip install highfis
```

Run a classifier:

```python
from highfis import HTSKClassifierEstimator

clf = HTSKClassifierEstimator(
    n_mfs=4,
    mf_init="kmeans",
    epochs=150,
    learning_rate=1e-3,
    random_state=42,
)
clf.fit(X_train, y_train)
print(f"Test accuracy: {clf.score(X_test, y_test):.4f}")
```

highFIS works with `sklearn.pipeline.Pipeline`, `GridSearchCV`, and
`cross_val_score`.

## Models Available

highFIS offers a family of TSK fuzzy models optimized for different
high-dimensional behaviors.

- `Vanilla TSK` — the original Takagi-Sugeno-Kang model with Gaussian MFs, product antecedent aggregation, and sum-based normalization.
- `HTSK` — high-dimensional TSK with geometric mean aggregation and log-space normalization to reduce dimensionality bias.
- `LogTSK` — log-space defuzzification with temperature scaling for numerically stable high-dimensional aggregation.
- `DombiTSK` — Dombi t-norm aggregation with first-order consequents and a learnable shape parameter.
- `AdaTSK` — adaptive Dombi inference using Composite Gaussian MFs with a positive lower bound.
- `FSRE-AdaTSK` — adaptive model with gated feature selection and rule extraction in the consequent.
- `DG-TSK` — double-gated training for simultaneous feature selection and rule extraction, followed by first-order fine tuning.
- `DG-ALETSK` — DG-based adaptive Ln-Exp softmin with embedded feature and rule gates for sparse high-dimensional modeling.

## 🔧 What’s Included

### Core models

- `HTSKClassifier`, `HTSKRegressor`
- `TSKClassifier`, `TSKRegressor`
- `DombiTSKClassifier`, `DombiTSKRegressor`
- `AdaTSKClassifier`, `AdaTSKRegressor`
- `DGALETSKClassifier`, `DGALETSKRegressor`
- `DGTSKClassifier`, `DGTSKRegressor`
- `FSREAdaTSKClassifier`, `FSREAdaTSKRegressor`
- `LogTSKClassifier`, `LogTSKRegressor`

### Estimator wrappers

- `HTSKClassifierEstimator`, `HTSKRegressorEstimator`
- `TSKClassifierEstimator`, `TSKRegressorEstimator`
- `LogTSKClassifierEstimator`, `LogTSKRegressorEstimator`
- `AdaTSKClassifierEstimator`, `AdaTSKRegressorEstimator`
- `DGALETSKClassifierEstimator`, `DGALETSKRegressorEstimator`
- `DGTSKClassifierEstimator`, `DGTSKRegressorEstimator`
- `FSREAdaTSKClassifierEstimator`, `FSREAdaTSKRegressorEstimator`

### Building blocks

- Memberships: `GaussianMF`, `TriangularMF`, `TrapezoidalMF`, `BellMF`, `SigmoidalMF`, `DiffSigmoidalMF`, `ProdSigmoidalMF`, `SShapedMF`, `LinSShapedMF`, `ZShapedMF`, `LinZShapedMF`, `PiMF`, `GaussianPIMF`
- Defuzzifiers: `SoftmaxLogDefuzzifier`, `SumBasedDefuzzifier`, `LogSumDefuzzifier`
- T-norms: `prod`, `min`, `gmean`, `dombi`
- Rule base strategies: `cartesian`, `coco`, `en`, `custom`
- Persistence: estimator `.save(path)` / `.load(path)` and versioned checkpoint validation via `highfis.persistence`

## 📚 Documentation

The published documentation is available at https://dcruzf.github.io/highFIS.

Key reference pages:

- [TSK Vanilla](https://dcruzf.github.io/highFIS/latest/models/tsk-vanilla)
- [LogTSK](https://dcruzf.github.io/highFIS/latest/models/logtsk)
- [HTSK](https://dcruzf.github.io/highFIS/latest/models/htsk)
- [DombiTSK](https://dcruzf.github.io/highFIS/latest/models/dombitsk)
- [AdaTSK](https://dcruzf.github.io/highFIS/latest/models/adatsk)
- [DGTSK](https://dcruzf.github.io/highFIS/latest/models/dg-tsk)
- [DG-ALETSK](https://dcruzf.github.io/highFIS/latest/models/dg-aletsk)
- [FSRE-AdaTSK](https://dcruzf.github.io/highFIS/latest/models/fsre-adatsk)
- [Persistence API](https://dcruzf.github.io/highFIS/latest/api/persistence)

## 🤝 Contributing & Development

See the published contribution guide at [contributing](https://dcruzf.github.io/highFIS/latest/contributing/).

## 📄 License

Distributed under the [GPLv3](LICENSE).
