Academic machine learning project for classifying Iris flower species using Python and scikit-learn.
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.
The repository includes the Iris dataset files:
data/iris.datadata/iris.namesdata/bezdekIris.data
| Category | Tools |
|---|---|
| Language | Python |
| Notebook | Jupyter / Google Colab |
| Data Analysis | pandas, NumPy |
| Machine Learning | scikit-learn |
| Visualization | Matplotlib |
The notebook demonstrates classification with three algorithms, compared on the same train/test split:
- Logistic Regression
- K-Nearest Neighbors, with the optimal
kselected viaGridSearchCV(5-fold cross-validation) - Support Vector Machine (RBF kernel)
Evaluation includes accuracy, a classification report, and a confusion matrix for the best-performing model.
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% |
The confusion matrix below shows the few versicolor/virginica confusions typical of this dataset — the two species overlap slightly in petal measurements:
Visualizing the decision boundary on the two most discriminative features (petal length & width) makes the class separation intuitive:
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
pip install -r requirements.txt
jupyter notebook notebooks/iris_classification.ipynbIf running from the notebook folder, adjust the dataset path to ../data/iris.data if necessary.
- Supervised classification
- Data preprocessing and label encoding
- Model training with scikit-learn
- Classification metrics and model comparison
Manassé Makuikila Lusaku
MIT License


