Skip to content

pyfuzzy-toolbox Documentation

Welcome to pyfuzzy-toolbox, a comprehensive Python library for Fuzzy Systems with focus on education and professional applications.

Features

  • 🧩 Core: Membership functions, fuzzy sets, linguistic variables, operators
  • 🎛️ Inference: Mamdani and Sugeno/TSK systems
  • 🧠 Learning: ANFIS, Wang-Mendel, metaheuristic optimization (PSO, DE, GA)
  • 🌊 Dynamics: Fuzzy ODEs and p-fuzzy systems
  • 🖥️ Web Interface: Interactive Streamlit app with one-command launch

Installation

Basic (Library only)

pip install pyfuzzy-toolbox

Full (with Web Interface)

pip install 'pyfuzzy-toolbox[ui]'
pip install pyfuzzy-toolbox[ui]

Launch Web Interface

pyfuzzy interface

Learn more in the CLI Guide.

Quick Example

import fuzzy_systems as fs

# Create Mamdani system
system = fs.MamdaniSystem()
system.add_input('temperature', (0, 40))
system.add_output('fan_speed', (0, 100))

# Add terms
system.add_term('temperature', 'cold', 'triangular', (0, 0, 20))
system.add_term('temperature', 'hot', 'triangular', (20, 40, 40))
system.add_term('fan_speed', 'slow', 'triangular', (0, 0, 50))
system.add_term('fan_speed', 'fast', 'triangular', (50, 100, 100))

# Add rules
system.add_rules([('cold', 'slow'), ('hot', 'fast')])

# Evaluate
result = system.evaluate(temperature=25)
print(f"Fan speed: {result['fan_speed']:.1f}%")

Community & Support

Citation

@software{pyfuzzy_toolbox,
  title = {pyfuzzy-toolbox: A Comprehensive Python Library for Fuzzy Systems},
  author = {Cecconello, Moiseis},
  year = {2025},
  url = {https://github.com/1moi6/pyfuzzy-toolbox}
}

License

MIT License - see LICENSE for details.