Skip to content

OSBrainer/IrisClassification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Iris Flower Classifier

Iris Flowers

An end-to-end machine learning pipeline for classifying Iris species. From data preparation and model training to evaluation and a Flask API for live predictions.


πŸš€ Features

  • Data Preparation
    • Load raw CSV, minimal cleaning, stratified train/test split
  • Model Training
    • Standard scaling + Logistic Regression
  • Evaluation
    • Accuracy, classification report, confusion matrix
  • API Service
    • Flask app exposing /predict endpoint for JSON input
  • Serialization
    • Model saved as models/iris_classifier.joblib

πŸ“ Repository Structure

iris-classifier/ β”œβ”€β”€ data/ β”‚ β”œβ”€β”€ raw/ # raw iris.csv β”‚ └── processed/ # train.csv & test.csv β”‚ β”œβ”€β”€ images/ β”‚ └── iris_flowers.png # illustration used in README β”‚ β”œβ”€β”€ models/ β”‚ └── iris_classifier.joblib # trained model pipeline β”‚ β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ data_prep.py # data loading & train/test split β”‚ β”œβ”€β”€ train.py # build & train model pipeline β”‚ β”œβ”€β”€ evaluate.py # compute metrics & print reports β”‚ └── app.py # Flask API for live inference β”‚ β”œβ”€β”€ requirements.txt # project dependencies └── README.md # this file


βš™οΈ Setup & Installation

  1. Install dependencies

pip install -r requirements.txt

  1. Prepare the data

python src/data_prep.py

  1. Train the model

python src/train.py
--input data/processed/train.csv
--output models/iris_classifier.joblib

  1. Evaluate Performance

python src/evaluate.py
--model-path models/iris_classifier.joblib
--test-data data/processed/test.csv

πŸ–₯️ Running the Flask API

cd src flask run --host=0.0.0.0 --port=5000

/predict Endpoint

Send a POST request with JSON body: { "sepal_length": 5.1, "sepal_width": 3.5, "petal_length": 1.4, "petal_width": 0.2 }

Response

{ "predicted_species": "Setosa", "confidence": 0.96 }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors