Calibrate a Checkout Fraud Model Under Extreme Class Imbalance
Last updated: November 29, 2026
Quick Overview
An online checkout fraud model is trained on data where 0.2% of orders are fraud, after downsampling legitimate orders 20 to 1. Explain how to choose metrics, correct the predicted probabilities, and set decision thresholds for block, review and approve.
Walmart Labs
November 29, 20260
0
0 solved
An online checkout fraud model is trained on data where 0.2% of orders are fraud, after downsampling legitimate orders 20 to 1. Explain how to choose metrics, correct the predicted probabilities, and set decision thresholds for block, review and approve.
Checkout risk decisions at Walmart balance chargeback losses against blocking good customers, often with a manual review team in the middle. The interviewer tests understanding of imbalance-aware metrics, probability calibration after resampling, and cost based thresholds under review capacity limits.
What the Interviewer Expects
- Prefer precision-recall metrics over accuracy and ROC AUC alone
- Correct probabilities after negative downsampling
- Calibrate with Platt scaling or isotonic regression on a clean holdout
- Set thresholds from expected cost and review capacity
- Handle delayed and censored fraud labels
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- Derive the probability correction for downsampling negatives by a factor.
- How would you choose between isotonic and Platt scaling?
- How do you evaluate when blocked orders never get a fraud label?
- How does review team capacity change the threshold?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
True fraud rate about 0.2%. Training kept all fraud and 1 in 20 legitimate orders, so the model sees a fraud rate near 4%. Decisions: approve, send to manual review (capacity around 0.5% of orders), o...
Approach
Evaluate with PR AUC and precision and recall at the operating points, not accuracy (99.8% by approving everyone). Correct the base rate, calibrate, then choose thresholds from costs and capacity....