Naive Bayes

For example,
Given msg = "Dear Friends", predict if it is Spam or Not-Spam

P(Spam|DearFriend)=P(DearFriend|Spam)P(Spam)P(DearFriend)=P(DearFriend|Spam)P(Spam)=P(Dear|Spam)P(Friend|Spam)P(Spam)

On the 2nd line, the denominator is ignored because it will be constant over all the data instances

Naive Bayes

P(X|x1,x2,...xn)=ip(xi|X)P(X)

Advantages of Naive Bayes?

  1. Works very well with many number of features
  2. Works well with large training dataset
  3. Converges faster
  4. Lesser overfitting
  5. Good at Handling Outliers
  6. Good at Handling Missing Data

Disadvantages of Naive bayes

  1. Doesn't work if there are correlated features

Impact of missing value on Naive Bayes

Naive Bayes is good at Handling Missing Data as when calculating the probability it ignores the missing value rows, so the missing value has no impact over the probability; hence no impact on naive bayes

Impact of outliers on Naive Bayes

Basic Naive bayes is not good at Handling Outliers as if in the test time there comes a feature which was not in the train set then there will be 0 probability which will make the whole probability to 0, but most of the time these situation are handled by introducing an artificial count to every feature.

Problems that can be solved using Naive Bayes

  1. Sentiment Analysis
  2. Spam Classification
  3. Twitter Sentiment Classification
  4. Document Categorization

Related Notes