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! ๐