Skip to content

About

πŸŒΈπŸ“Š A Streamlit ML app to classify Iris flowers 🌼 into Setosa, Versicolor, or Virginica using scikit-learn πŸš€

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

🌸 Iris Classification Project

An interactive Machine Learning web application built with Streamlit, designed to classify Iris flowers into Setosa, Versicolor, or Virginica from four simple measurements.
Clean UI. Accurate predictions. Ready to use. 🌱


πŸ”— Quick Access

πŸš€ Launch App Open in Colab πŸ“‚ View Repository


πŸ“Έ App Preview

Iris Classification App Screenshot


🧠 How It Works

1) Dataset

We use the classic Iris dataset (150 samples; 3 species):

  • Features
    • sepal_length (cm)
    • sepal_width (cm)
    • petal_length (cm)
    • petal_width (cm)
  • Label
    • species ∈ {Iris-setosa, Iris-versicolor, Iris-virginica}

Dataset file: IRIS.csv

2) Model Training (in iris.ipynb)

  • Train/test split: 80/20 (random_state=2)
  • Classifier: Gaussian Naive Bayes (sklearn.naive_bayes.GaussianNB)
  • Save the trained model to trained_model.sav (via pickle.dump)

3) App Logic (Streamlit)

  • Sliders for the four measurements
  • Click Result to run inference

✨ Features

  • Minimal, responsive UI
  • Fast, lightweight model
  • Clear training pipeline in Jupyter Notebook
  • Ready-to-deploy model file

πŸ› οΈ Tech Stack

Python pandas scikit-learn Streamlit pickle


πŸ“‚ Project Structure

β”œβ”€β”€ IRIS.csv β”œβ”€β”€ iris.ipynb β”œβ”€β”€ trained_model.sav β”œβ”€β”€ streamlit_app.py β”œβ”€β”€ requirements.txt └── README.md

πŸ” Notes & Tips

  • Feature order: Enter the values in this order β†’ [sepal_length, sepal_width, petal_length, petal_width]
  • Units: All measurements are in centimeters (cm).
  • Value range:
    • Sepal Length: 4.3 – 7.9 cm
    • Sepal Width: 2.0 – 4.4 cm
    • Petal Length: 1.0 – 6.9 cm
    • Petal Width: 0.1 – 2.5 cm
  • Use the sliders in the app to adjust values and see predictions instantly.
  • No installation needed if you use the Launch App button β€” it runs in your browser.
  • For offline use:
    1. Download the repo.
    2. Install requirements:
      pip install -r requirements.txt
      
    3. Run the app:
      streamlit run streamlit_app.py
      
  • Try slightly changing values to see how predictions switch between Setosa, Versicolor, and Virginica.

πŸš€ Future Usage & Improvements

This project can be extended and improved in several ways:

  • More datasets – Allow users to choose from multiple datasets (e.g., other flower species).
  • Model selection – Let users pick different ML algorithms (RandomForest, SVM, etc.) and compare results.
  • Accuracy display – Show the model’s confidence score alongside predictions.
  • Data visualization – Add scatter plots or histograms to visualize inputs vs. predictions.
  • Mobile optimization – Improve the UI for mobile screens.
  • User input history – Show a table of previous predictions during the same session.
  • Cloud deployment – Host on Streamlit Cloud, Hugging Face Spaces, or AWS for broader access.

πŸ“š References


πŸ§‘β€πŸ’» Author

Mohammed Alawfi

πŸ“ Madinah, Saudi Arabia

GitHub
LinkedIn


πŸ“œ License

This project is licensed under the MIT License. See LICENSE for details.

About

πŸŒΈπŸ“Š A Streamlit ML app to classify Iris flowers 🌼 into Setosa, Versicolor, or Virginica using scikit-learn πŸš€

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages