Skip to content

shiva-ml-dev/adaptive-ml-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

76 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Adaptive ML Monitoring & Auto-Retraining System

A production-level adaptive ML system with real-time monitoring, drift detection, and automated retraining β€” built as a fresher.

Python FastAPI Streamlit MLOps Status


🎯 Problem Statement

Machine learning models deployed in real-world environments silently degrade over time due to data drift and changing patterns. Most teams discover this too late β€” after predictions have already become unreliable.

Traditional ML systems lack continuous monitoring, performance tracking, and automated retraining, requiring constant manual intervention to maintain model effectiveness.


πŸ’‘ Solution

I built a production-ready adaptive ML system that:

  • Performs real-time predictions via FastAPI
  • Monitors model accuracy continuously
  • Detects data drift automatically
  • Retrains the model when performance drops
  • Updates itself β€” zero manual intervention required

πŸ”— Live Demo

Service Link
πŸ–₯️ Streamlit Dashboard Open Dashboard
⚑ FastAPI Backend Open API
πŸ“„ API Docs Open Docs

🧠 System Architecture

Adaptive ML System Architecture

Real-Time Prediction Pipeline

User β†’ Streamlit UI β†’ FastAPI β†’ ML Model β†’ Predictions

Monitoring & Retraining Pipeline

Logs β†’ Scheduler (60s) β†’ Monitoring β†’ Drift Detection β†’ Retraining β†’ Updated Model

πŸ”„ How It Works

  1. User inputs data via Streamlit UI
  2. FastAPI returns real-time prediction
  3. Predictions are logged automatically
  4. Accuracy is monitored continuously
  5. Drift detection checks for data changes
  6. Low accuracy β†’ retraining triggered automatically
  7. Updated model deployed β€” no manual work needed

πŸ“Š Dashboard Demo

🎯 Current Accuracy

Accuracy

πŸ“ˆ Accuracy Over Time

Accuracy Graph

πŸ”΄ Drift Status

Drift Status

βœ… Before vs After Retraining

Before After

⚑ Live Prediction

Live Prediction


πŸ“ˆ Model Performance

Metric Score
Accuracy 91%
Precision 89%
Recall 87%
F1 Score 88%

Confusion Matrix

Predicted 0 Predicted 1
Actual 0 45 5
Actual 1 6 44

βš™οΈ Key Features

Feature Description
⚑ Real-time Prediction FastAPI serves live predictions
πŸ“Š Accuracy Monitoring Continuous model health tracking
πŸ”΄ Drift Detection Statistical comparison of data distributions
πŸ”„ Auto Retraining Triggered when accuracy drops below threshold
⏱️ Scheduler Runs every 60 seconds automatically
πŸ–₯️ Live Dashboard Streamlit monitoring dashboard

πŸ› οΈ Tech Stack

Category Technology
Language Python 3.10
ML Scikit-learn, Pandas, NumPy
Backend API FastAPI
Frontend UI Streamlit
Deployment Render (API) + Streamlit Cloud
Model Random Forest Classifier

🧠 Model Selection

A Random Forest model was chosen for its robustness, ability to handle non-linear patterns, and strong performance on tabular data. It provides reliable predictions with minimal overfitting β€” ideal for real-world production systems.


πŸ“‚ Project Structure

adaptive-ml-system/
│── app/              # FastAPI backend
│── dashboard/        # Streamlit UI
│── monitoring/       # Drift detection & accuracy tracking
│── retraining/       # Auto-retraining pipeline
│── data/             # Dataset
│── models/           # Trained models
│── logs/             # Prediction logs (CSV)
│── tests/            # Unit tests
│── scheduler.py      # 60s automated scheduler
│── requirements.txt

🌟 Key Highlights

  • βœ… End-to-end ML system (UI + API + Monitoring + Retraining)
  • βœ… Self-improving ML pipeline β€” heals itself automatically
  • βœ… Production deployment on Render + Streamlit Cloud
  • βœ… Real-time drift detection and automated retraining
  • βœ… Built as a fresher β€” demonstrates production-level thinking

▢️ Run Locally

pip install -r requirements.txt
python scheduler.py
streamlit run dashboard/app.py

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

Shivashankar Kakanale Machine Learning Engineer | Production-Ready ML Systems & APIs

πŸ” Actively seeking Machine Learning Internship and Entry-Level ML Engineer opportunities in Bengaluru

πŸ™ GitHub github.com/shiva-ml-dev
πŸ’Ό LinkedIn linkedin.com/in/shivashankar-kakanale
πŸ“§ Email kakanaleshivashankar0@gmail.com

About

End-to-end adaptive ML system with real-time prediction, monitoring, drift detection, and automated retraining using FastAPI and Streamlit

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages