Skip to content

Latest commit

 

History

History

README.md

🌟 Naive Bayes Classifier — Iris Dataset 🌟

Typing Animation


📌 Introduction

The Naive Bayes Classifier is a simple yet highly effective algorithm based on Bayes’ Theorem.
It assumes that all features are independent (naive assumption) but still delivers strong performance on many datasets.
💡 Ideal for quick, interpretable, and accurate classification.


🧠 How It Works

  1. Prior Probability — How frequent each class is in the dataset.
  2. Likelihood — Probability of a feature value for each class.
  3. Posterior Probability — Combining prior & likelihood using Bayes’ Theorem.
  4. Prediction — Selecting the class with the highest posterior probability.

📊 Dataset Overview

Iris Dataset Preview

  • Name: Iris Dataset
  • Samples: 150
  • Features: Sepal Length, Sepal Width, Petal Length, Petal Width
  • Classes: Setosa, Versicolor, Virginica

🎨 Feature Relationships

Iris Pairplot Visualization

The pairplot shows strong class separability, especially in Petal Length and Petal Width, making Naive Bayes well-suited for this dataset.


📈 Model Results

Naive Bayes Confusion Matrix

Accuracy: 97.77%


🔢 Classification Report

Class Precision Recall F1-score
Setosa 1.00 1.00 1.00
Versicolor 1.00 0.94 0.97
Virginica 0.92 1.00 0.96

🚀 Key Insights

  • Fast — Training & prediction happen in milliseconds.
  • 📊 Accurate — Nearly perfect classification on Iris.
  • 🧠 Simple — Easy to interpret & explain.
  • 🎯 Multi-class Ready — Handles 3+ classes without extra steps.

🏆 Part of the Machine Learning Blueprints Series

This project is part of the Machine Learning Blueprints — a curated set of ML implementations with clean code, real datasets, and visual insights.


⭐ If you enjoyed this, please star the repository to support more high-quality ML projects.