RTO risk predictor
Two-stage LightGBM system for cash-on-delivery return-to-origin risk on real PostEx shipment data: a checkout-time model (17 features) and a post-order model (47 features), both with isotonic calibration.
Engineered five feature layers (order, customer, H3 geospatial, network/graph, temporal). Added Optuna tuning, SHAP reason codes, and champion–challenger promotion gates for retraining. Served both models through a Flask REST API with Docker and pytest. Audited explanations and fixed SHAP wording that contradicted feature values in 26% of reasons.
Stage 2 held-out test (launch thresholds cleared). Stage 1: ROC-AUC 0.90, PR-AUC 0.85.
- 0.92 ROC-AUC
- 0.91 PR-AUC
- 0.02 ECE
- 93% Precision @ 50% recall
Python, LightGBM, Optuna, SHAP, Flask, Docker, pytest