Skip to content

Aaricacoding/mlops-pipeline

Repository files navigation

title MLOps Pipeline
emoji 🌸
colorFrom green
colorTo purple
sdk docker
pinned false

🌸 Iris Intelligence : MLOps Pipeline with Docker

Author: Aarica Raj GitHub: @Aaricacoding Live Demo: https://mlops-pipeline-py3l.onrender.com Tech Stack: Python · Scikit-learn · Flask · Docker · Docker Compose · Render


📸 Web Preview

Web Preview


🎥 Demo Video

Watch Demo Video


📌 What is this project?

Iris Intelligence is a complete end-to-end MLOps pipeline that:

  • Trains a Random Forest ML model on the classic Iris dataset
  • Serves predictions via a Flask REST API
  • Features a stunning 3D UI with particle effects and card tilt animations
  • Packaged in a Docker container runs anywhere!

The app predicts the Iris flower species (Setosa, Versicolor, Virginica) based on 4 measurements - accessible from any device through a public URL!


🎆 UI Features:

Feature Detail
3D Spinning Flower Colorful flower rotates in 3D at the top
Particle Network 60 floating particles with connecting lines
3D Card Tilt Cards tilt in 3D on mouse hover
Gradient Text Title shimmers with sage to blush gradient
Glowing Inputs Inputs glow green when focused
Shimmer Button Light sweeps across button on hover
Pulsing Result Result card glows and pulses on prediction
Dark Theme Deep dark background with color accents

🧠 How Does It Work? (Architecture)

┌─────────────────────────────────────────────────┐
│                Docker Container                  │
│                                                  │
│  ┌──────────────┐     ┌───────────────────────┐  │
│  │ train_       │     │     Flask REST API     │  │
│  │ model.py     │────▶│  GET  /  → 3D Web UI  │  │
│  │              │     │  POST /predict → ML    │  │
│  │ Trains &     │     │  GET  /health → Check  │  │
│  │ saves        │     └──────────┬────────────  │  │
│  │ model.pkl    │               │               │  │
│  └──────────────┘               ▼               │  │
│                    ┌────────────────────────┐   │  │
│                    │  Random Forest Model   │   │  │
│                    │  Accuracy: ~97%        │   │  │
│                    └────────────────────────┘   │  │
└─────────────────────────────────────────────────┘
         │
         ▼
  Browser / Phone / Any Device 🌍

Key Concepts:

Concept Explanation
MLOps Combining ML + DevOps for production deployment
Docker Packages app + dependencies into portable container
Flask Lightweight Python web framework for REST APIs
REST API Standardized way for apps to communicate over HTTP
Random Forest Ensemble ML model using multiple decision trees
Docker Compose Tool to manage multi-container Docker apps

📁 Project Structure

mlops-pipeline/
│
├── app.py               ← Flask REST API + 3D Web UI
├── train_model.py       ← Train and save ML model
├── model.pkl            ← Saved trained model (auto-generated)
├── requirements.txt     ← Python dependencies
├── Dockerfile           ← Docker container configuration
├── docker-compose.yml   ← Docker Compose configuration
└── README.md            ← This documentation

⚙️ Setup & Run

Option 1 : Run with Docker 🐳 (Recommended)

# Step 1 : Clone repo
git clone https://github.com/Aaricacoding/mlops-pipeline.git
cd mlops-pipeline

# Step 2 : Build Docker image
docker build -t mlops-pipeline .

# Step 3 : Run container
docker run -p 8080:8080 mlops-pipeline

Option 2 : Run with Docker Compose

docker-compose up --build

Option 3 : Run without Docker

pip install -r requirements.txt
python train_model.py
python app.py

Open in Browser:

https://mlops-pipeline-py3l.onrender.com

🚀 API Endpoints

Endpoint Method Description
/ GET 3D Web UI — predict from browser
/predict POST Predict flower species
/health GET Check if API is running

Example API Request:

curl -X POST https://mlops-pipeline-py3l.onrender.com/predict \
  -H "Content-Type: application/json" \
  -d '{
    "sepal_length": 5.1,
    "sepal_width": 3.5,
    "petal_length": 1.4,
    "petal_width": 0.2
  }'

Example Response:

{
  "species": "Setosa",
  "confidence": 99.0,
  "prediction": 0
}

🧪 Example Predictions:

Sepal L Sepal W Petal L Petal W Species
5.1 3.5 1.4 0.2 🌸 Setosa
6.3 3.3 4.7 1.6 🌺 Versicolor
6.5 3.0 5.2 2.0 🌹 Virginica

🔧 Technologies Used:

Tool Purpose
Python 3.10 Core programming language
Scikit-learn ML model training (Random Forest)
Flask REST API framework
Docker Containerization
Docker Compose Container orchestration
NumPy Numerical computations

💡 What I Learned Building This:

  • How to build a production-ready ML API using Flask
  • How to containerize a Python app using Docker
  • How Dockerfile works step by step
  • How Docker Compose simplifies deployment
  • How to create a REST API for ML models
  • How to build a 3D interactive UI with vanilla CSS/JS
  • End-to-end MLOps pipeline from training to deployment

🔮 Future Improvements:

  • Add MLFlow for experiment tracking
  • Add CI/CD pipeline with GitHub Actions
  • Deploy on AWS/GCP/Azure cloud
  • Add model versioning
  • Add Kubernetes for scaling
  • Add monitoring with Prometheus + Grafana
  • Custom domain setup

📄 License

MIT License — free to use, modify, and share!


🙏 Acknowledgements

About

🌸 Iris Flower Species Predictor : End-to-end MLOps pipeline with Random Forest ML model, Flask REST API, and Docker containerization. Features a stunning 3D UI with particle effects. Deployable on any cloud platform.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors