Solved – Advantage of Bernoulli Naive Bayes over Multinomial in Text Classification

machine learningnatural language

While I understand the difference between Multinomial Naive Bayes algorithm and Bernoulli, based on my understanding, Multinomial is always a preferred method for any sort of Text classification(Spam detection, topic categorization, sentiment analysis) as taking the frequency of the word into consideration will have better accuracy than just checking for word occurrence.

Is there any practical use case where Bernoulli will be preferred over Multinomial? Is there any real world example that favors Bernoulli over Multinomial?

Best Answer

taking the frequency of the word into consideration will have better accuracy than just checking for word occurrence.

Not necessarily. Multinomial Naive Bayes is in a sense more complex model (you can reduce it to Bernoulli).

Because of that, Bernoulli model can be trained using less data and be less prone to overfitting. You might want to read on bias-variance tradeoff if you want to get more technical explanation why sometimes it's better to use simpler model.

For a concrete example see this notebook that compares aforementioned methods on SMS Spam Collection Data Set. It seems like Bernoulli NB performs better.