Skip to content

makuikila/iris-classification-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Iris Classification in Python

Academic machine learning project for classifying Iris flower species using Python and scikit-learn.

Project Overview

This project applies supervised classification methods to the classic Iris dataset. The notebook includes data loading, preprocessing, train/test splitting, model training, evaluation metrics, and classification reports.

Dataset

The repository includes the Iris dataset files:

  • data/iris.data
  • data/iris.names
  • data/bezdekIris.data

Technologies

Category Tools
Language Python
Notebook Jupyter / Google Colab
Data Analysis pandas, NumPy
Machine Learning scikit-learn
Visualization Matplotlib

Models and Evaluation

The notebook demonstrates classification with three algorithms, compared on the same train/test split:

  • Logistic Regression
  • K-Nearest Neighbors, with the optimal k selected via GridSearchCV (5-fold cross-validation)
  • Support Vector Machine (RBF kernel)

Evaluation includes accuracy, a classification report, and a confusion matrix for the best-performing model.

Results

On a 70/30 stratified train/test split, KNN (tuned) reached the best accuracy:

Model Test Accuracy
Logistic Regression 91.1%
KNN (tuned) 95.6%
SVM (RBF) 93.3%

Model accuracy comparison

The confusion matrix below shows the few versicolor/virginica confusions typical of this dataset — the two species overlap slightly in petal measurements:

Confusion matrix

Visualizing the decision boundary on the two most discriminative features (petal length & width) makes the class separation intuitive:

Decision boundary

Repository Structure

iris-classification-python/
├── README.md
├── LICENSE
├── requirements.txt
├── .gitignore
├── data/
│   ├── iris.data
│   ├── iris.names
│   └── bezdekIris.data
├── assets/
│   ├── accuracy_comparison.png
│   ├── confusion_matrix.png
│   └── decision_boundary.png
└── notebooks/
    └── iris_classification.ipynb

How to Run

pip install -r requirements.txt
jupyter notebook notebooks/iris_classification.ipynb

If running from the notebook folder, adjust the dataset path to ../data/iris.data if necessary.

Skills Demonstrated

  • Supervised classification
  • Data preprocessing and label encoding
  • Model training with scikit-learn
  • Classification metrics and model comparison

Author

Manassé Makuikila Lusaku

License

MIT License

About

Supervised machine learning project for classifying Iris flower species using Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors