Naive Bayes interview question

Machine LearningNaive Bayesbasic

What is the "naive" assumption in Naive Bayes?

  1. AThe features are independent of the class label, so the class prior alone drives every prediction of the model.
  2. BEvery feature follows a normal distribution within each class, whatever the actual type of the input data is.
  3. CThe features are conditionally independent of each other given the class, so their likelihoods can be multiplied.
  4. DAll classes have the same prior probability, so the prior can be dropped from Bayes' theorem for every prediction.
Show the answer and explanation

Correct answer: C, The features are conditionally independent of each other given the class, so their likelihoods can be multiplied.

Explanation Naive Bayes

Naive Bayes applies Bayes' theorem and assumes the features are conditionally independent given the class:

P(y | x₁, …, xₙ) ∝ P(y) · Π P(xᵢ | y)

This turns one hard-to-estimate joint distribution into n simple per-feature distributions, which makes training fast and works with little data. The assumption is rarely true (words in an email are correlated), yet the classifier often ranks classes well; its probability estimates, however, tend to be poorly calibrated.

Why the other answers are wrong:

  • If features were independent of the class they would carry no information; Naive Bayes relies on P(xᵢ | y) differing across classes.
  • A normal distribution per feature is the extra assumption of Gaussian Naive Bayes only, not the naive assumption itself.
  • Naive Bayes estimates class priors from the data (e.g. class frequencies); they need not be equal.

Interview tip: say "conditional independence given the class", not just "independent features"; interviewers listen for the word conditional.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Machine Learning questions

  1. Which description matches the standard k-means (Lloyd's) algorithm?
  2. What does precision measure for a binary classifier?
  3. How does k-fold cross-validation work?
  4. How does grid search look for good hyperparameters?
  5. What is the difference between batch gradient descent and stochastic gradient descent (SGD)?