pyFUME

A Python package for automatic Fuzzy Model Estimation from data.

pyFUME is a comprehensive Python library designed to automate the estimation of Takagi-Sugeno fuzzy models directly from data. By integrating seamless model building with the Simpful library, it enables researchers to transform raw datasets into interpretable, executable fuzzy systems. Simpful is another of our project: check it out here.

GitHub stars PyPI version License

Fuzzy Logic Model Estimation

Key Features

  • Automated Estimation: Determine antecedent sets and consequent parameters of Takagi-Sugeno models.
  • Feature Selection: Built-in support for advanced wrappers like fst-pso (Particle Swarm Optimization).
  • Interpretability: Bridges the gap between raw data and human-understandable fuzzy rules.
  • Simpful Integration: Automatically generates executable Python code for fuzzy inference.
  • Performance Evaluation: Facilities for error calculation (MAE, MSE) and visualization.

Quick Start

Getting started with pyFUME is as simple as:

pip install pyfume
from pyfume import pyFUME

# Generate the Takagi-Sugeno Fuzzy Inference System (FIS)
# using 3 clusters and PSO-based feature selection
FIS = pyFUME(datapath='./data.csv', nr_clus=3, feature_selection='fst-pso')

# Evaluate accuracy
MAE = FIS.calculate_error(method="MAE")
print(f"Model Error: {MAE}")

# Use the model for prediction
model = FIS.get_model()
model.set_variable('Cement', 300.0)
print(model.Sugeno_inference(['OUTPUT']))

Technical Highlights

Clustering

Uses Fuzzy C-Means (FCM) to identify data structures in input-output space.

Estimation

Automatically determines membership function shapes (Gaussian/Triangular).

Synthesis

Generates 'Simpful_code.py' for immediate deployment in production.

Related Publications

2024

  1. Our Fruitful Relationship with Sugeno Inference, from FUMOSO to pyFUME
    Leone Bacciu, Paolo Cazzaniga, Chiara Gallese, and 4 more authors
    In International Conference on Information Processing and Management of Uncertainty in Knowledge-Based Systems, 2024

2023

  1. Estimation of fuzzy models from mixed data sets with pyFUME
    Daniele M Papetti, Caro Fuchs, Vasco Coelho, and 2 more authors
    In 2023 IEEE Conference on Computational Intelligence in Bioinformatics and Computational Biology (CIBCB), 2023

2020

  1. pyFUME: a Python package for fuzzy model estimation
    Caro Fuchs, Simone Spolaor, Marco S Nobile, and 1 more author
    In 2020 IEEE international conference on fuzzy systems (FUZZ-IEEE), 2020