Intern: Omokhoa Oshose Tosayoname
Intern ID: CA/DF1/71570
Duration: 20th May 2026 – 20th June 2026
This project trains and evaluates multiple machine learning classification models on the classic Iris dataset. The objective is to classify Iris flowers into three species based on four physical measurements.
Species:
- Iris setosa
- Iris versicolor
- Iris virginica
Features used:
- Sepal Length (cm)
- Sepal Width (cm)
- Petal Length (cm)
- Petal Width (cm)
CodeAlpha_IrisClassification/
├── data/
│ └── Iris.csv # Dataset
├── notebooks/
│ └── iris_classification.ipynb # Main notebook
├── requirements.txt
└── README.md
| Model | Description |
|---|---|
| K-Nearest Neighbours (KNN) | Instance-based learner; K=5 default, tuned up to K=20 |
| Support Vector Machine (SVM) | RBF kernel; optimal for non-linear boundaries |
| Random Forest | Ensemble of 100 decision trees |
| Logistic Regression | Baseline linear classifier |
- All four models achieved very high accuracy (above 93%) on the test set.
- Petal Length and Petal Width are the most discriminative features.
- Iris setosa is perfectly linearly separable from the other two species.
- Iris versicolor and Iris virginica show slight overlap in sepal dimensions but are well separated by petal dimensions.
- Class distribution bar chart
- Feature distributions by species (histograms)
- Pairplot of all feature combinations
- Correlation heatmap
- Box plots per feature per species
- Confusion matrices for all four models
- Model performance comparison chart
- Random Forest feature importance chart
- KNN accuracy vs. K tuning curve
- Decision boundary plots (KNN and SVM on petal features)
-
Clone this repository:
git clone https://github.com/Tosa9/CodeAlpha_IrisClassification.git cd CodeAlpha_IrisClassification -
Install dependencies:
pip install -r requirements.txt
-
Launch the notebook:
jupyter notebook notebooks/iris_classification.ipynb
See requirements.txt for the full list.
CodeAlpha Data Science Internship | Task 1
#CodeAlpha #DataScience #MachineLearning #IrisClassification