Skip to content

PyCoder913/Mamdani-FIS-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mamdani Fuzzy Inference System-based Classification

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.


πŸ“Œ Objectives

  • 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).

🧠 Methodology

Step 1: Fuzzify the Dataset

  • Define fuzzy sets (e.g., small, large) for each input feature.
  • Convert crisp feature values to fuzzy linguistic values using membership functions.

Step 2: Learn Rules using Fuzzy Decision Tree

  • Train a decision tree with the best hyperparameters (that maximize accuracy) on the fuzzified data.
  • Extract rules from the trained tree.

Step 3: Build the Mamdani FIS

  • Convert decision tree rules into fuzzy inference rules.
  • Construct the FIS using these rules.

Step 4: Test the Classifier

  • Classify test samples using different defuzzification strategies: MoM, SoM, LoM, etc.
  • Evaluate accuracy, precision, recall, and F1 score.

πŸ§ͺ Results (on Iris Test Set)

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

πŸ’‘ Explainability Features (XAI)

  • 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.


πŸ‘¨β€πŸ’» Author

Rajdeep Pathak
M.Sc. Mathematics and Computing
IIT Hyderabad


πŸ“š References

  • 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.

About

Building a Mamdani Fuzzy Inference System (FIS)-based classifier using fuzzy rules learned directly from data using fuzzy decision trees.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors