Correcting Predicted Probabilities After Negative Downsampling

Last updated: November 29, 2026

Quick Overview

To save compute, a like-prediction model was trained after keeping only 5% of negative examples. Explain why its outputs are too high and write a function that corrects them.

TikTok
Machine Learning
Machine Learning Engineer
TikTok
November 29, 2026
Machine Learning Engineer
Phone Screen
Machine Learning
Easy

0

0

0 solved


To save compute, a like-prediction model was trained after keeping only 5% of negative examples. Explain why its outputs are too high and write a function that corrects them.

Negative downsampling is standard for TikTok scale training because negatives vastly outnumber positives. Phone screens check that you can derive the correction and know where to apply it.

What the Interviewer Expects
  • Explain how downsampling changes the base rate the model learns
  • Derive the odds correction
  • Implement the correction
  • Note that ranking within a request is unaffected but absolute values matter
  • Say where calibration still needs checking
Key Topics to Cover
calibration
negative downsampling
odds ratio
imbalanced data
probability correction
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
  • Does downsampling change AUC?
  • What if you also upsampled positives?
  • Why might you prefer this over a learned calibration layer?
  • What happens if the keep rate changes between model versions?
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

Confirm the keep rate w=0.05w = 0.05 for negatives, that positives were all kept, and whether the scores feed a system needing absolute probabilities (score fusion, ads pricing)....

Approach

Keeping 5% of negatives multiplies the odds of a positive in training data by 1/w=201/w = 20. The model learns those inflated odds. To recover the true probability, divide the predicted odds by 20....


Submit Your Answer
Markdown supported