Why is the decision boundary of Multinomial Naive Bayes linear in log space?

Quick Overview

Why does Multinomial Naive Bayes produce a linear decision boundary once its scores are written in log form? The question tests deriving the log posterior from word counts, reading off the weight vector and bias, and relating Naive Bayes to logistic regression and other linear classifiers.

Why is the decision boundary of Multinomial Naive Bayes linear in log space?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

Multinomial Naive Bayes classifies a document from its vector of word counts. Why is the decision boundary of Multinomial Naive Bayes linear in log space? ```hint Start from the likelihood Write $P(x \mid c)$ for a document with count vector $x$, take the log, and look at how each count enters the expression. ``` ```hint Compare two classes Subtract the log scores of two classes. Check which terms cancel and what form the remainder has. ``` ### What a Strong Answer Covers - The multinomial likelihood written in terms of word counts and per-class word probabilities. - What taking logs does to the product and to the counts. - The difference of two class scores written as a weight vector and a bias, with both stated explicitly. - The role of the independence assumption in keeping interaction terms out. - What the result says about how Naive Bayes relates to other linear classifiers. ### Follow-up Questions - With more than two classes, what shape do the decision regions take? - Does Laplace smoothing change the linearity? What does it change? - When is the boundary of Gaussian Naive Bayes linear, and when is it quadratic? - Multinomial Naive Bayes and logistic regression are both linear in the counts. When would you expect each one to do better?

Overview: Why does Multinomial Naive Bayes produce a linear decision boundary once its scores are written in log form? The question tests deriving the log posterior from word counts, reading off the weight vector and bias, and relating Naive Bayes to logistic regression and other linear classifiers.

PracHub logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

Multinomial Naive Bayes classifies a document from its vector of word counts. Why is the decision boundary of Multinomial Naive Bayes linear in log space?

What a Strong Answer Covers Guidance

  • The multinomial likelihood written in terms of word counts and per-class word probabilities.
  • What taking logs does to the product and to the counts.
  • The difference of two class scores written as a weight vector and a bias, with both stated explicitly.
  • The role of the independence assumption in keeping interaction terms out.
  • What the result says about how Naive Bayes relates to other linear classifiers.

Follow-up Questions Guidance

  • With more than two classes, what shape do the decision regions take?
  • Does Laplace smoothing change the linearity? What does it change?
  • When is the boundary of Gaussian Naive Bayes linear, and when is it quadratic?
  • Multinomial Naive Bayes and logistic regression are both linear in the counts. When would you expect each one to do better?