19

MLOps model deployment pipeline

Automated retraining pipeline with PSI-based drift detection, model versioning, and champion/challenger promotion for a churn prediction model.

Drift detection Model versioning CI/CD Champion/challenger Docker GitHub Actions
6 steps
Automated pipeline stages

Overview

End-to-end ML pipeline with data validation, training, evaluation, and conditional promotion

Production ML models degrade over time as incoming data distributions shift. This pipeline wraps a churn prediction model in six automated stages: data validation, feature engineering, model training, holdout evaluation, champion/challenger comparison, and conditional promotion. PSI monitors every numeric feature for drift, and the pipeline runs automatically via GitHub Actions on every push to main.

Validate
Schema, nulls
Features
Engineer, scale
Train
GBM, 5-fold CV
Evaluate
Holdout metrics
Compare
A vs B
Promote
If better

Interactive dashboard

Five-page Streamlit application for pipeline monitoring and control

Pipeline status
  • Step-by-step run breakdown with durations
  • Holdout metrics at a glance
  • Data validation results
Model registry
  • All versions with timestamps and metrics
  • Production flag indicator
  • Metrics trend over time
Drift monitor
  • PSI per feature with threshold lines
  • Distribution overlays (train vs incoming)
  • Retrain trigger indicators
Model comparison
  • Champion vs challenger radar chart
  • Side-by-side metric tables
  • Promotion recommendation
Retrain
  • One-click data regeneration and pipeline trigger
  • Full run history with AUC, F1, and drift flags
  • Automated promotion decisions logged for audit
$ pip install -r requirements.txt $ python data/generate_data.py $ python -m src.pipeline $ streamlit run app.py

Pipeline architecture

Six-stage pipeline with conditional promotion and drift monitoring

6
Pipeline stages
PSI
Drift detection method
0.85+
ROC AUC on holdout
CI/CD
GitHub Actions

Monitoring

The pipeline monitors data quality and model performance continuously. PSI (Population Stability Index) is computed for every numeric feature by comparing the incoming data distribution against the training baseline. Features with PSI above 0.25 trigger a retraining recommendation. The champion/challenger pattern ensures new models are only promoted when they beat the current production model by a configurable margin on ROC AUC. Every run is logged with full metrics for audit.

Ingest data
Validate schema and nulls
Compute PSI
Per-feature drift scores
Decision
Retrain or keep

How to run

Local, Docker, or CI/CD — pick your deployment path

Local
  • pip install -r requirements.txt
  • python data/generate_data.py
  • python -m src.pipeline
  • streamlit run app.py
Docker
  • docker build -t mlops-pipeline .
  • docker run -p 8501:8501 mlops-pipeline
  • Visit http://localhost:8501

Links