This repository contains the code and explanation behind a fuzzy logic-based classifier using a Fuzzy Inference System (FIS). The classifier learns interpretable rules from data using a Fuzzy Decision Tree (FuzzyDT) and applies these to classify samples through a Mamdani FIS. The classic Iris dataset is used to demonstrate the method.
- Learn fuzzy if-then classification rules from a dataset using a fuzzy decision tree.
- Build a Mamdani-type FIS that uses these rules for classification.
- Demonstrate the performance and interpretability of fuzzy rule-based classification.
- Highlight the relevance to explainable AI (XAI).
- Define fuzzy sets (e.g., small, large) for each input feature.
- Convert crisp feature values to fuzzy linguistic values using membership functions.
- Train a decision tree with the best hyperparameters (that maximize accuracy) on the fuzzified data.
- Extract rules from the trained tree.
- Convert decision tree rules into fuzzy inference rules.
- Construct the FIS using these rules.
- Classify test samples using different defuzzification strategies: MoM, SoM, LoM, etc.
- Evaluate accuracy, precision, recall, and F1 score.
| Defuzzification Method | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|
| Centroid | 30.00% | 9.00% | 30.00% | 0.1385 |
| Bisector | 30.00% | 9.00% | 30.00% | 0.1385 |
| Mean of Max (MoM) | 93.33% | 93.64% | 93.33% | 0.9333 |
| Smallest of Max (SoM) | 93.33% | 93.44% | 93.33% | 0.9346 |
| Largest of Max (LoM) | 96.67% | 96.99% | 96.67% | 0.9665 |
- Transparent: Uses interpretable if-then rules in natural language.
- Traceable: Every output is linked to the rules that fired.
- Human-centered: Ideal for domains like healthcare where decisions must be explained.
Rajdeep Pathak
M.Sc. Mathematics and Computing
IIT Hyderabad
- Cintra, M. E. et al. (2013). FuzzyDT - A Fuzzy Decision Tree Algorithm Based on C4.5.
- Breiman, L., Friedman, J. H., Olshen, R., & Stone, C. (1984). Classification and Regression Trees.
- Chang, R. L. P. & Pavlidis, T. (1977). Fuzzy Decision Tree Algorithms. IEEE Trans. on Systems, Man, and Cybernetics.
- Zadeh, L. A. (1965). Fuzzy Sets. Information and Control, 8, 338β353.