2025 · XGBoost · FastAPI · Docker
Customer Churn MLOps
End-to-end MLOps: a 3-model benchmark served via FastAPI with data-drift monitoring.
- 0.855
- XGBoost ROC-AUC
- 0.858
- Random Forest ROC-AUC
- 0.868
- XGBoost accuracy
- 10,000 rows
- Dataset
Problem
Banks lose revenue to churn they could pre-empt. This predicts which of 10,000 customers are likely to leave, with confidence scores, and ships it as a monitored, containerized service — not a notebook.
Approach
- 01Feature engineering: tenure/age grouping, balance-to-salary ratio, and engagement scoring.
- 02Benchmarked Logistic Regression, Random Forest, and XGBoost; all serialized and switchable via the API.
- 03FastAPI single + batch endpoints with preprocessing baked in.
- 04Custom drift detection logs predictions (JSONL) and compares live data to the training distribution.
Architecture
- Raw CSV → clean → feature engineering → scale
- Train LR / RF / XGBoost (benchmarked)
- FastAPI single + batch inference
- Drift monitor vs. training distribution
- Docker Compose deployment
Challenges
- Serving three switchable models behind one API with consistent preprocessing.
- Detecting drift without a heavyweight platform — comparing live distributions to training.
Key features
- 3-model benchmark, switchable via API
- Single + batch inference endpoints
- Custom data-drift monitoring (JSONL logs)
- Feature-engineering pipeline
- Docker Compose + GitHub Actions CI