How can absence of a word affect BernoulliNB while contributing no count term in MultinomialNB?
Classic MLLevel: IntermediateEvidence from absent words
How can absence of a word affect BernoulliNB while contributing no count term in MultinomialNB?
Hints
- Write likelihoods for a zero-valued feature.
- Binary events include the negative outcome.
Answer
BernoulliNB models both presence and absence through binary probabilities. Multinomial text likelihood counts occurrences, so a zero count does not add an occurrence contribution.
Source and licence: scikit-learn 1.7.2 — naive bayes · BSD-3-Clause · answer: Quantoros editorial