Skip to content

Shiva341-sudo/Iris_classification_using_streamlit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌸 Iris Flower Classification & Interactive EDA

An end-to-end Machine Learning pipeline that explores, visualizes, and classifies the classic Iris Dataset. This project trains a machine learning classifier to accurately distinguish between three distinct species of Iris flowers using structural floral features.

📌 Project Architecture

This repository contains a structured analytical pipeline divided into three major stages:

1. Exploratory Data Analysis (EDA)

Understanding data relationships before modeling via high-quality data visualizations:

  • Class Balance Verification: Assessing target variable distributions via frequency count plots.
  • Feature Clustering Assessment: Generating a complete pair-wise scatter plot matrix (pairplot) to see structural boundaries between classes.
  • Multicollinearity Analysis: Creating a custom correlation heatmap (coolwarm colormap) to identify highly correlated independent features.

2. Preprocessing & Data Engineering

  • Dimensionality Reduction: Dropping the arbitrary database primary key (Id) to prevent the model from capturing a synthetic linear pattern.
  • Target Label Encoding: Transforming categorical species labels (Iris-setosa, Iris-versicolor, Iris-virginica) into numerical target integers ($0, 1, 2$) using LabelEncoder.
  • Stratified Splitting: Implementing a 20% test split explicitly leveraging stratify=y to preserve exact target class distributions across training sets and prevent split bias.

3. Model Implementation & Diagnostic Evaluation

  • Supervised Learning: Fitting a DecisionTreeClassifier configured with reproducible global random states.
  • Performance Measurement: Evaluating classification boundaries using overall accuracy, comprehensive classification summaries (precision, recall, f1-score), and visual Confusion Matrices.
  • Model Interpretability: Computing exact mathematical feature importance vectors to display which geometric properties dictate flower identification.

🛠️ Technical Stack

Category Tools / Libraries Used
Core Language Python 3.x
Data Manipulation pandas, numpy
Data Visualization seaborn, matplotlib
Machine Learning scikit-learn

📈 Pipeline Highlights & Metrics Summary

The code includes critical data science practices that protect against common model failures:

Why Stratification Matters: The use of stratify=y ensures that each flower class is equally represented in both your training set and testing set. Without this, a random split could accidentally put all of one species into the test set, completely crippling the training process.

The evaluation suite outputs the following diagnostic assets:

  • Accuracy Score: Direct percentage metric of overall correct predictions.
  • Classification Report: Precision and recall per class to confirm there are no weak spots in individual species identification.
  • Feature Importance Chart: Visually ranks features so you can verify if biological assumptions match mathematical model weights (e.g., assessing the predictive power of Petal Width vs. Sepal Length).

About

An interactive Streamlit web app for Iris flower classification. IRIS dataset, explore EDA visualizations, train and compare 5 ML models, evaluate performance metrics, and predict species in real time — all from a clean browser UI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors