Iris Flower Classification – Machine Learning Project 📌 Overview
This project demonstrates Machine Learning classification using the classic Iris dataset. The Iris dataset contains measurements of 150 iris flowers from three different species (Setosa, Versicolor, Virginica). Each sample has 4 features:
Sepal length
Sepal width
Petal length
Petal width
The goal of this project is to build a model that can classify iris flowers into the correct species based on these features.
⚙️ Tech Stack
Python 3.10+
Libraries used:
pandas – data handling
numpy – numerical operations
scikit-learn – ML model & preprocessing
matplotlib & seaborn – data visualization
joblib – model saving/loading
🚀 Steps in the Project
Dataset Loading
Loaded the Iris dataset from sklearn.datasets.
Exploration
Checked shape and class distribution.
Visualized the dataset.
Data Preprocessing
Standardized features using StandardScaler.
Train-Test Split
Training: 80%
Testing: 20%
Model Training
Used K-Nearest Neighbors (KNN) classifier.
Evaluation
Accuracy score.
Classification report.
Confusion matrix visualization.
Model Saving
Trained model stored as iris_knn_model.joblib.
Prediction Demo
Example test prediction to verify the trained model.
📊 Results
Achieved 96–98% accuracy on the test dataset.
Confusion Matrix clearly shows correct classification for all 3 flower types.
Confusion Matrix
📂 Project Structure iris-ml-classification/ │ ├── main.py # Main project code ├── iris_knn_model.joblib # Saved trained model ├── requirements.txt # Project dependencies ├── confusion_matrix.png # Example output plot └── README.md # Project documentation
🔧 Installation & Usage
Clone the repo:
git clone https://github.com/your-username/iris-ml-classification.git cd iris-ml-classification
Install dependencies:
pip install -r requirements.txt
Run the project:
python main.py
🔮 Future Improvements
Experiment with different algorithms (SVM, Random Forest, Logistic Regression).
Perform hyperparameter tuning with GridSearchCV.
Deploy the model as a web app using Flask or Streamlit.
Extend dataset for real-world flower classification.
✨ Author
👤 Vishal Borana BCA Student | Aspiring Data Scientist | Passionate about Machine Learning 🚀