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
November 29, 20260
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
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
- 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 PrepSample Answer
Clarify
Confirm the keep rate 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 . The model learns those inflated odds. To recover the true probability, divide the predicted odds by 20....