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
Machine Learning
Machine Learning Engineer
Walmart Labs
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

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
Class imbalance
Probability calibration
Downsampling correction
Cost-sensitive thresholds
Label delay and selection bias
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. 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 Prep
Sample 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....


Submit Your Answer
Markdown supported