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
Machine Learning
Data Scientist
Capital One
November 29, 2026
Data Scientist
Technical Screen
Machine Learning
Hard

0

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
calibration
downsampling
Bayes rule
imbalanced data
probability estimates
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
  • 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 Prep
Sample Answer
Clarify
  • Full data fraud rate about 0.1%. Training kept all fraud and a fraction β=0.01\beta = 0.01 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:


Submit Your Answer
Markdown supported