Challenge
The task was to identify customers at risk of a late refill from historical transactions. The rare positive class, time-dependent features and changing customer behaviour make a random train/test split misleading.
Applied ML case study · 2026
A leakage-aware temporal modelling pipeline for prescription refill risk, with calibration and explicit analysis of dataset shift.
Challenge
The task was to identify customers at risk of a late refill from historical transactions. The rare positive class, time-dependent features and changing customer behaviour make a random train/test split misleading.
My role
I built temporal features, designed a chronological validation strategy and compared logistic regression, random forest and XGBoost models with probability calibration.
Outcome
The later test period exposed a substantial performance drop. Instead of presenting an optimistic validation score, the analysis concludes that the current model should not be deployed.
At a glance
System view
A simplified view of the stages and boundaries that shape the project.
Approach
Features only use information available at prediction time, and validation/test periods follow training chronologically.
PR-AUC, calibration and threshold behaviour are more informative than accuracy on a heavily imbalanced target.
A threshold selected on validation produced no useful test predictions. That is a deployment blocker, not a metric to hide.
Findings
Engineering reflection
This project is valuable because it demonstrates restraint: the right outcome of an ML experiment can be a well-supported decision not to deploy.