You trained Naive Bayes on balanced data but deploy on data where positives are 1%. What happens and what do you do?
hardAnswer
- The prior P(c) in Bayes' rule shifts, so probabilities and thresholds are off.
- Fixes: (1) refit priors from the deployment distribution while keeping the likelihoods from training — this is exactly what you need since P(c) is easy to estimate from deployment counts; (2) equivalently, adjust logit predictions by per class; (3) recalibrate on a small deployment-labelled sample if you can get one.
Check yourself — multiple choice
- Nothing — Bayes' rule is prior-free
- Update the class priors to the deployment distribution (or shift logits accordingly)
- Retrain from scratch on 50/50 data
- Drop the minority class
Priors are what change under label shift — patch them, keep the likelihoods.
#naive-bayes#imbalance#calibration
Practise Supervised Learning
215 interview questions in this topic.
Related questions
- The 'naive' independence assumption is almost always false. Why does Naive Bayes still work?
- How do you select the decision threshold for a binary classifier?
- When should you use PR-AUC instead of ROC-AUC?
- How do you handle class imbalance in a dataset?
- Why is the base rate of the positive class critical to know?
- How do class weights work in logistic regression, and when do you use them?