EasyDeepLearn

You trained Naive Bayes on balanced data but deploy on data where positives are 1%. What happens and what do you do?

hard

Answer

  • 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 (P(xc))(P(x \mid c)) from training — this is exactly what you need since P(c) is easy to estimate from deployment counts; (2) equivalently, adjust logit predictions by log(Pdeploy(c)  /  Ptrain(c))\operatorname{log}(P_{\mathrm{deploy}}(c)\; / \;P_{\mathrm{train}}(c)) 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