Skip to content

Classifying iris flowers into species using KNN and SVM, with model performance comparisons and metrics.

License

Notifications You must be signed in to change notification settings

AhmedMT3/KNN-SVM-Classifiers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

🌸 Iris Flower Classification with KNN & SVM

Open in Colab

This project demonstrates K-Nearest Neighbors (KNN) and Support Vector Machine (SVM) for classifying iris flowers 🌺 into three species: Setosa, Versicolor, and Virginica. A great way to dive into the basics of classification and explore algorithm comparison!

📋 Project Goals

  • 🛠 Implement the KNN and SVM models on a classic dataset
  • 📊 Compare Performance of the models with cross-validation
  • 📈 Evaluate Metrics including accuracy, precision, recall & F1-score to find the best-performing model

📚 Dataset

We’re using the well-known Iris dataset 🌿, containing measurements of different iris species:

  • Features: Sepal length, sepal width, petal length, and petal width
  • Classes: Three species: Setosa, Versicolor, Virginica (50 samples each)

With this dataset, we’ll predict species based on a flower’s sepal and petal measurements.

⚙️ Requirements

To get started, you’ll need:

  • Python 3.6+ and Jupyter Notebook or Google Colab
  • Required libraries: pandas, numpy, and scikit-learn

Install dependencies with:

pip install pandas numpy scikit-learn

🚀 How to Use

  1. Upload iris.csv (available here) when prompted 📂.
  2. Run the Notebook:
    • If using Google Colab, upload the file when prompted in the notebook.
    • If running locally, ensure iris.csv is in the same directory as the notebook.

🏆 Results

The notebook provides a comprehensive comparison of KNN vs. SVM based on evaluation metrics. By the end, you’ll understand which model performs best and why, with a detailed breakdown of each model’s strengths on the Iris dataset! 🌟

About

Classifying iris flowers into species using KNN and SVM, with model performance comparisons and metrics.

Resources

License

Stars

Watchers

Forks