Recalibrate Fraud Probabilities After Downsampling Legitimate Transactions
Last updated: November 29, 2026
Quick Overview
To train a fraud model you kept every fraud transaction but only 1% of legitimate ones. Derive how to convert the model's output back to true probabilities, implement the correction, and explain how to check calibration afterward.
Capital One
November 29, 20260
0
0 solved
To train a fraud model you kept every fraud transaction but only 1% of legitimate ones. Derive how to convert the model's output back to true probabilities, implement the correction, and explain how to check calibration afterward.
Capital One's card fraud models train on billions of transactions, so negative downsampling is routine, but downstream strategy rules use the score as a probability. The interviewer checks Bayes-rule reasoning about sampling, the closed-form correction, and calibration diagnostics.
What the Interviewer Expects
- Explains that downsampling shifts the prior, not the likelihood ratio
- Derives the odds correction from Bayes' rule
- Implements and sanity checks the formula
- Validates with reliability curves and expected calibration error on unsampled data
- Mentions Platt or isotonic recalibration when the model itself is miscalibrated
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
- What if you also upweighted fraud with class weights?
- How does the correction interact with a model trained with focal loss?
- Why might calibration drift after a fraud attack wave even if ranking is fine?
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
- Full data fraud rate about 0.1%. Training kept all fraud and a fraction of legitimate transactions, so training fraud rate is about 9%.
- The model is a well-calibrated estimator on t...
Approach
Sampling only legitimate rows leaves the feature distribution within each class unchanged, so the likelihood ratio is preserved; only the prior changes. In odds form: