Recalibrate a Save Prediction Model After Negative Downsampling

Last updated: November 29, 2026

Quick Overview

To train a save prediction model efficiently you kept all positive examples and 5% of negatives. The model's predicted probabilities are now far too high. Explain why and how to correct them, and how you would verify calibration.

Pinterest
Machine Learning
Machine Learning Engineer
Pinterest
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Medium

0

0

0 solved


To train a save prediction model efficiently you kept all positive examples and 5% of negatives. The model's predicted probabilities are now far too high. Explain why and how to correct them, and how you would verify calibration.

Pinterest trains engagement models on enormous impression logs where positives are rare, so negative downsampling is standard. Because these probabilities feed ad auctions and blended ranking, the interviewer expects you to derive the correction and talk about verifying calibration in production.

What the Interviewer Expects
  • Explains how downsampling shifts the base rate and inflates odds
  • Derives the correction p = q / (q + (1 - q)/w) with w the negative sampling rate
  • Distinguishes ranking order (unchanged) from calibrated probabilities (changed)
  • Verifies with reliability diagrams and calibration error on unsampled data
  • Mentions Platt or isotonic recalibration on a fresh holdout
Key Topics to Cover
calibration
negative downsampling
imbalanced data
logistic regression
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 does the ranking order not change after the correction?
  • If you also weight examples by recency, does the formula still hold?
  • How would you monitor calibration drift after deployment?
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
  • Original save rate on impressions: about 2%.
  • Training data: all positives, a random 5% of negatives (w = 0.05).
  • The model is logistic (sigmoid output); predictions are used as probabilities by a...
Approach

Downsampling negatives multiplies the odds of the positive class by 1/w. A model trained on the sampled data learns those inflated odds. Undo it by multiplying the predicted odds by w, which gives a c...


Submit Your Answer
Markdown supported