A comprehensive Python library for fuzzy systems: inference (Mamdani, Sugeno), learning (ANFIS, Wang-Mendel, MandaniLearning), and dynamics (p-fuzzy, fuzzy ODEs)
Project description
pyfuzzy-toolbox
A comprehensive Python library for Fuzzy Systems with focus on education and professional applications. Includes inference, learning, fuzzy differential equations, and p-fuzzy systems.
๐ Documentation
Read the full documentation โ
- Getting Started: Installation and quick tutorials
- User Guides: In-depth guides for each module
- API Reference: Complete method documentation
- Examples: 18+ interactive Colab notebooks
๐ฆ Installation
Basic Installation (Library only)
pip install pyfuzzy-toolbox
Full Installation (with Web Interface)
For the complete experience including the interactive web interface:
macOS/Linux (Zsh/Bash):
pip install 'pyfuzzy-toolbox[ui]'
Windows (PowerShell/CMD):
pip install pyfuzzy-toolbox[ui]
Note: Package name is pyfuzzy-toolbox, import as fuzzy_systems:
import fuzzy_systems as fs
๐ฅ๏ธ Web Interface (NEW!)
Launch the interactive web interface with a single command:
pyfuzzy interface
This opens a modern Streamlit-based interface featuring:
- ๐ฏ ANFIS: Complete workflow (data โ training โ evaluation โ prediction)
- ๐ Interactive visualizations: Membership functions, decision surfaces, training curves
- ๐ฎ Real-time predictions: Manual input or batch CSV upload
- ๐ Model analysis: Rules visualization, feature importance, sensitivity analysis
- ๐พ Export capabilities: Models, predictions, and results
CLI Commands
# Launch web interface (browser opens automatically)
pyfuzzy interface
# Custom port and dark theme
pyfuzzy interface --port 8080 --dark-theme
# Headless mode (no browser)
pyfuzzy interface --no-browser
# Show version
pyfuzzy version
# Help
pyfuzzy --help
Programmatic API
Launch the interface from Python code or Jupyter notebooks:
from fuzzy_systems import launch_interface
# Simple launch
launch_interface()
# Custom configuration
launch_interface(
port=8080,
theme='dark',
open_browser=True
)
๐งฉ Core Modules
fuzzy_systems.core
Fundamental fuzzy logic components
- Membership functions:
triangular,trapezoidal,gaussian,sigmoid,generalized_bell - Classes:
FuzzySet,LinguisticVariable - Operators:
fuzzy_and_min,fuzzy_or_max,fuzzy_not
fuzzy_systems.inference
Fuzzy inference systems
- MamdaniSystem: Classic fuzzy inference with defuzzification (COG, MOM, etc.)
- SugenoSystem: TSK systems with functional outputs (order 0 and 1)
fuzzy_systems.learning
Learning and optimization
- ANFIS: Adaptive Neuro-Fuzzy Inference System
- WangMendel: Automatic rule generation from data
- MamdaniLearning: Gradient descent and metaheuristics (PSO, DE, GA)
fuzzy_systems.dynamics
Fuzzy dynamic systems
- FuzzyODE: Solve ODEs with fuzzy uncertainty (ฮฑ-level method)
- PFuzzySystem: Discrete and continuous p-fuzzy systems
๐ Interactive Notebooks
Explore hands-on examples organized by topic:
| Topic | Notebooks | Description |
|---|---|---|
| 01_fundamentals | 2 notebooks | Membership functions, fuzzy sets, operators, fuzzification |
| 02_inference | 4 notebooks | Mamdani and Sugeno systems |
| 03_learning | 7 notebooks | Wang-Mendel, ANFIS, optimization |
| 04_dynamics | 5 notebooks | Fuzzy ODEs, p-fuzzy systems |
All notebooks can be opened directly in Google Colab!
๐ Quick Start Guides
Comprehensive guides for each module with theory, examples, and best practices:
๐๏ธ Inference Systems
Build fuzzy control systems and decision-making tools.
|
Linguistic fuzzy inference with interpretable rules.
|
Efficient inference with mathematical consequents.
|
๐ง Learning & Optimization
Automatic rule generation and parameter tuning from data.
|
Single-pass rule extraction.
|
Neuro-fuzzy hybrid learning.
|
Optimize existing systems.
|
๐ Dynamic Systems
Model temporal evolution with fuzzy uncertainty.
|
Discrete-time dynamics.
|
Continuous-time dynamics.
|
ODEs with fuzzy uncertainty.
|
โก 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}%")
๐ Links
- Documentation: https://1moi6.github.io/pyfuzzy-toolbox/
- PyPI: https://pypi.org/project/pyfuzzy-toolbox/
- GitHub: https://github.com/1moi6/pyfuzzy-toolbox
๐ 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},
note = {Includes inference, learning, fuzzy differential equations, and p-fuzzy systems}
}
๐ License
MIT License - see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyfuzzy_toolbox-1.1.8.tar.gz.
File metadata
- Download URL: pyfuzzy_toolbox-1.1.8.tar.gz
- Upload date:
- Size: 6.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d738c31d3dc5733a9c363e2eb09668c67328210ee2bf441e6b6bad801e931fa6
|
|
| MD5 |
51a8fe17a784121fea1823d94571812a
|
|
| BLAKE2b-256 |
8d3384bc3d718ce4f10fb193db34a2ed3f3a8dfdede2ed05eb093d18f5a7dbc8
|
File details
Details for the file pyfuzzy_toolbox-1.1.8-py3-none-any.whl.
File metadata
- Download URL: pyfuzzy_toolbox-1.1.8-py3-none-any.whl
- Upload date:
- Size: 314.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c637f094f8947d58dbab35f4838984897c1f80ab488ad002b1c7f0c2996fe128
|
|
| MD5 |
9a9b782e889534f9dff31d4867a2c933
|
|
| BLAKE2b-256 |
fff0605a7d21f0c34c154dff9f1776d3dbda981164902657a1ead72a5aee5ee6
|