Skip to content

ImSatyamK/iris-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

🌸 Iris Flower Classification using Machine Learning

📌 Project Overview

This project demonstrates a supervised machine learning classification task using the Iris dataset. The objective is to predict the species of an Iris flower based on its physical measurements using scikit-learn.

The model classifies flowers into:

  • Iris Setosa
  • Iris Versicolor
  • Iris Virginica

📊 Dataset Information

  • Dataset: Iris Dataset (built-in with scikit-learn)
  • Total Samples: 150
  • Features (4):
    • Sepal Length
    • Sepal Width
    • Petal Length
    • Petal Width
  • Target Classes (3):
    • Setosa
    • Versicolor
    • Virginica

🧠 Machine Learning Workflow

  1. Load the dataset
  2. Split data into training and testing sets
  3. Scale features using StandardScaler
  4. Train a classification model
  5. Evaluate the model
  6. Predict new samples

⚙️ Technologies Used

  • Python 3
  • scikit-learn
  • NumPy
  • Pandas
  • Matplotlib (optional)

📦 Installation

Install required dependencies:

pip install scikit-learn numpy pandas matplotlib

🚀 How to Run

python iris_classification.py

🧪 Model Used

K-Nearest Neighbors (KNN)

  • Distance-based classifier
  • Requires feature scaling
  • Performs well on the Iris dataset

Other models you can try:

  • Logistic Regression
  • Support Vector Machine (SVM)
  • Decision Tree

📈 Model Evaluation

Metrics used:

  • Accuracy Score
  • Classification Report
  • Confusion Matrix

Expected Accuracy: 95% – 100%


🔍 Feature Scaling

StandardScaler standardizes features to:

  • Mean = 0
  • Standard Deviation = 1

Scaler is fitted only on training data to prevent data leakage.


🧠 Sample Prediction

Input:

[5.1, 3.5, 1.4, 0.2]

Output:

Predicted Class: Setosa

📁 Project Structure

iris-classification/
│
├── iris_classification.py
├── README.md
└── requirements.txt

📚 Learning Outcomes

  • Supervised classification
  • ML pipeline best practices
  • Feature scaling importance
  • Model evaluation techniques
  • Avoiding data leakage

📜 License

This project is intended for educational use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors