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!
- 🛠 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
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.
To get started, you’ll need:
- Python 3.6+ and Jupyter Notebook or Google Colab
- Required libraries:
pandas
,numpy
, andscikit-learn
Install dependencies with:
pip install pandas numpy scikit-learn
- Upload
iris.csv
(available here) when prompted 📂. - 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.
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! 🌟