How does Categorical Naive Bayes differ from Multinomial Naive Bayes when handling discrete nominal categories?

Quick Overview

Compare Categorical Naive Bayes and Multinomial Naive Bayes for nominal features such as color, city or device. Tests understanding of how each model normalizes its likelihoods, what input encoding it expects, how smoothing behaves after one-hot encoding, and how to handle unseen categories.

How does Categorical Naive Bayes differ from Multinomial Naive Bayes when handling discrete nominal categories?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How does Categorical Naive Bayes differ from Multinomial Naive Bayes when handling discrete nominal categories? Think of features such as color, city or device type, where each sample takes exactly one value per feature and the values have no order. ```hint Check the normalization For each model, write the formula for one likelihood term and ask what set of values its probabilities sum to 1 over. ``` ### What a Strong Answer Covers - The likelihood each model assumes and what its probabilities are normalized over - What input each model expects, and what goes wrong when raw category codes are fed to Multinomial NB - How one-hot encoding plus Multinomial NB compares to Categorical NB, including the effect of smoothing - Practical handling of unseen and rare categories ### Follow-up Questions - With smoothing turned off, do one-hot Multinomial NB and Categorical NB make the same predictions? Why or why not? - How would you handle a nominal feature with 50,000 distinct values in Naive Bayes? - When would you choose Bernoulli NB over either of these? - How would you combine categorical and continuous features in one Naive Bayes model?

Overview: Compare Categorical Naive Bayes and Multinomial Naive Bayes for nominal features such as color, city or device. Tests understanding of how each model normalizes its likelihoods, what input encoding it expects, how smoothing behaves after one-hot encoding, and how to handle unseen categories.

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

How does Categorical Naive Bayes differ from Multinomial Naive Bayes when handling discrete nominal categories?

Think of features such as color, city or device type, where each sample takes exactly one value per feature and the values have no order.

What a Strong Answer Covers Guidance

  • The likelihood each model assumes and what its probabilities are normalized over
  • What input each model expects, and what goes wrong when raw category codes are fed to Multinomial NB
  • How one-hot encoding plus Multinomial NB compares to Categorical NB, including the effect of smoothing
  • Practical handling of unseen and rare categories

Follow-up Questions Guidance

  • With smoothing turned off, do one-hot Multinomial NB and Categorical NB make the same predictions? Why or why not?
  • How would you handle a nominal feature with 50,000 distinct values in Naive Bayes?
  • When would you choose Bernoulli NB over either of these?
  • How would you combine categorical and continuous features in one Naive Bayes model?