How are class priors estimated during Naive Bayes training?

Quick Overview

Asks how a Naive Bayes classifier estimates its class priors during training and when that default estimate should be replaced. Tests maximum-likelihood estimation from label counts, smoothing, fixed or uniform priors, and correcting for a class mix that differs in deployment.

How are class priors estimated during Naive Bayes training?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

How are class priors estimated during Naive Bayes training? Also say when the default estimate is the wrong one to use. ```hint Where the labels come from The default estimate needs nothing but the labels. Then ask whether the class mix in the training data matches the class mix the model will see in production. ``` ### What a Strong Answer Covers - The default estimate and why it is the maximum-likelihood choice - How the prior enters the prediction - Smoothing and the alternatives to frequency-based priors - When frequency priors are biased, and how to correct for that ### Follow-up Questions - The model was trained on a class-balanced resample, but production has 5% positives. What do you change, and do you need to retrain? - How does the choice of prior interact with the decision threshold you pick on the posterior? - How would you update the priors in a streaming setting where the class mix drifts over time?

Overview: Asks how a Naive Bayes classifier estimates its class priors during training and when that default estimate should be replaced. Tests maximum-likelihood estimation from label counts, smoothing, fixed or uniform priors, and correcting for a class mix that differs in deployment.

PracHub logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

How are class priors estimated during Naive Bayes training?

Also say when the default estimate is the wrong one to use.

What a Strong Answer Covers Guidance

  • The default estimate and why it is the maximum-likelihood choice
  • How the prior enters the prediction
  • Smoothing and the alternatives to frequency-based priors
  • When frequency priors are biased, and how to correct for that

Follow-up Questions Guidance

  • The model was trained on a class-balanced resample, but production has 5% positives. What do you change, and do you need to retrain?
  • How does the choice of prior interact with the decision threshold you pick on the posterior?
  • How would you update the priors in a streaming setting where the class mix drifts over time?