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