Daniel notes
you@here:~/articles/highfis$ cat index.md

#fuzzy #pytorch #tsk

highFIS

highFIS is a PyTorch library for Takagi-Sugeno-Kang (TSK) fuzzy systems on high-dimensional data. It offers differentiable fuzzy inference that stays numerically stable when there are hundreds or thousands of features, behind estimators compatible with scikit-learn, for classification and for regression.

pip install highfis
from highfis import HTSKClassifier

clf = HTSKClassifier(
    n_mfs=5,
    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}")

Note

highFIS runs on PyTorch, which does not run inside a browser, so this block is for reading. The effect the library is built around can be reproduced with NumPy alone, and that demo does run here.

What is in it

  • Thirteen model families, from vanilla TSK to gated models that select features and prune rules while they train. Each has a classifier and a regressor. The model families is a map of them.
  • Two levels of interface: scikit-learn style estimators that work with Pipeline, GridSearchCV and cross_val_score, and the PyTorch model classes underneath for when you need the training loop.
  • Numerical stability by design: aggregation and normalization are done in log space.
  • Building blocks you can swap: membership functions, T-norms, defuzzifiers and rule bases.
  • Training options: Adam, AdamW and SGD, early stopping on a validation set, and a uniform rule regularization that keeps all rules in use.

Articles

What Where
Documentation https://dcruzf.github.io/highFIS/
Source https://github.com/dcruzf/highFIS
Package https://pypi.org/project/highfis/
License GPLv3