Calibrating a Rare Refund Abuse Model After Negative Downsampling

Last updated: November 29, 2026

Quick Overview

DoorDash trains a model to flag refund abuse, which affects 0.5% of refund requests. The team kept only 2% of negatives during training, and now the model's scores look far too high in production. Explain why and fix the calibration.

DoorDash
Machine Learning
Machine Learning Engineer
DoorDash
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Hard

0

0

0 solved


DoorDash trains a model to flag refund abuse, which affects 0.5% of refund requests. The team kept only 2% of negatives during training, and now the model's scores look far too high in production. Explain why and fix the calibration.

Fraud and abuse models at DoorDash feed into automated refund decisions, so probability scores must mean what they say. The interviewer checks understanding of class imbalance, the math of downsampling correction, and how calibration interacts with cost-based thresholds.

What the Interviewer Expects
  • Explain how negative downsampling shifts predicted probabilities
  • Derive the prior correction formula
  • Measure calibration with reliability curves or ECE
  • Choose metrics suited to rare events such as precision-recall
  • Set a decision threshold using costs of false positives and false negatives
Key Topics to Cover
class imbalance
calibration
downsampling correction
precision-recall
decision thresholds
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
  • Why not just train on the full imbalanced data?
  • When would you use Platt scaling or isotonic regression instead of the formula?
  • How does calibration drift over time, and how would you monitor it?
  • How would you pick a threshold if a false positive angers a loyal customer?
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

Positives 0.5%. Training kept all positives and 2% of negatives, so the training set has about 20% positives. Scores are used to auto-deny or route refunds to manual review....

Approach

A model trained on the downsampled set learns odds that are inflated by the inverse keep rate 1/r1/r. Correct the odds back: oddstrue=r⋅oddssample\text{odds}_{true} = r \cdot \text{odds}_{sample}. Then verify calibration...


Submit Your Answer
Markdown supported