Examples Gallery¶
Explore practical examples through interactive Colab notebooks organized by topic and difficulty.
🔰 Fundamentals (Beginner)¶
Learn the basics of fuzzy logic.
Membership Functions¶
What you'll learn:
- Triangular, trapezoidal, gaussian, sigmoid functions
- FuzzySet and LinguisticVariable classes
- Fuzzification process
- Fuzzy operators (AND, OR, NOT)
Estimated time: 45-60 min
Thermal Comfort System¶
What you'll learn: - Model multiple variables (temperature + humidity) - Combine variables with fuzzy operators - Implement simple IF-THEN rules - Create 2D comfort maps
Estimated time: 40-50 min
🎛️ Inference Systems (Intermediate)¶
Build complete fuzzy inference systems.
Mamdani Tipping System¶
What you'll learn: - Complete Mamdani inference system - 5 Mamdani steps: fuzzification → rules → implication → aggregation → defuzzification - Multiple inputs (service + food quality) - 3D control surfaces
Estimated time: 60-75 min
Sugeno Zero-Order System¶
What you'll learn: - Sugeno system with constant outputs - Difference between Mamdani and Sugeno - Weighted average defuzzification
Estimated time: 45-60 min
Sugeno First-Order System¶
What you'll learn: - Sugeno with linear output functions: y = ax + b - Function approximation - Comparison with zero-order
Estimated time: 40-50 min
Voting Prediction¶
What you'll learn: - Real-world application - Complex rule base - Multiple inputs (income + education)
Estimated time: 50-70 min
🧠 Learning & Optimization (Advanced)¶
Automatic rule generation and system optimization.
Wang-Mendel: Nonlinear Approximation¶
What you'll learn: - Automatic rule generation from data - Single-pass learning algorithm - Function approximation: f(x) = sin(x) + 0.1x - Rule conflict resolution
Estimated time: 60-75 min
Wang-Mendel: Linear Function¶
What you'll learn: - Simple case study - Effect of number of partitions - Performance metrics (MSE, RMSE, R²)
Estimated time: 40-50 min
Wang-Mendel: Iris Classification¶
What you'll learn: - Classification with Wang-Mendel - Multi-class fuzzy classification - Interpretable fuzzy rules
Estimated time: 50-65 min
ANFIS: Iris Classification¶
What you'll learn: - Adaptive Neuro-Fuzzy Inference System - Gradient-based learning (backpropagation) - Membership function refinement - Lyapunov stability monitoring
Estimated time: 60-75 min
ANFIS: Regression¶
What you'll learn: - ANFIS for regression problems - Nonlinear function approximation - Comparison with neural networks
Estimated time: 50-65 min
Rules Optimization with PSO¶
What you'll learn: - Particle Swarm Optimization (PSO) - Metaheuristic optimization - Optimize membership function parameters
Estimated time: 50-65 min
Rules Optimization: Iris¶
What you'll learn: - Comparison: PSO vs DE vs GA - Classification optimization - Best practices
Estimated time: 55-70 min
🌊 Dynamic Systems (Advanced)¶
Fuzzy systems with time evolution.
p-Fuzzy Discrete: Predator-Prey¶
What you'll learn: - Discrete p-fuzzy systems: x_{n+1} = x_n + f(x_n) - Population dynamics with fuzzy rules - Phase space analysis - Multiple initial conditions
Estimated time: 50-65 min
p-Fuzzy Continuous: Predator-Prey¶
What you'll learn: - Continuous p-fuzzy: dx/dt = f(x) - ODE integration (Euler, RK4) - Oscillatory dynamics - Vector fields
Estimated time: 60-75 min
p-Fuzzy Discrete: Population Growth¶
What you'll learn: - Single population model - Logistic-like fuzzy dynamics - Bifurcation analysis
Estimated time: 45-60 min
Fuzzy ODE: Logistic Growth¶
What you'll learn: - ODEs with fuzzy parameters/initial conditions - α-level method for uncertainty propagation - Fuzzy envelopes
Estimated time: 55-70 min
Fuzzy ODE: Holling-Tanner¶
What you'll learn: - System of ODEs with fuzzy uncertainty - Multi-dimensional envelopes - Phase space with uncertainty
Estimated time: 60-75 min
By Difficulty Level¶
🟢 Beginner (0-2 notebooks recommended)¶
- Membership Functions
- Thermal Comfort
🟡 Intermediate (After fundamentals)¶
- All Inference Systems (Mamdani, Sugeno, Voting)
🔴 Advanced (Requires ML/math background)¶
- All Learning notebooks (Wang-Mendel, ANFIS, PSO)
- All Dynamics notebooks (p-fuzzy, Fuzzy ODEs)
Running the Examples¶
On Google Colab (Recommended)¶
- Click any "Open in Colab" badge
- Run the first cell to install:
!pip install pyfuzzy-toolbox - Execute cells sequentially
Locally¶
# Clone repository
git clone https://github.com/1moi6/pyfuzzy-toolbox.git
cd pyfuzzy-toolbox/notebooks_colab
# Install dependencies
pip install pyfuzzy-toolbox jupyter
# Launch Jupyter
jupyter notebook
Need Help?¶
- API Reference: Detailed documentation of all methods
- User Guide: Conceptual explanations and tutorials
- GitHub Issues: Report problems or ask questions