Professional Documents
Culture Documents
Machine Learning: Naive Bayes Classifier
Machine Learning: Naive Bayes Classifier
Machine Learning: Naive Bayes Classifier
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Naive Bayes Classification
• Will my flight be on time? It is Sunny, Hot, Normal Humidity, and not Windy!
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !3
Probabilistic Independence
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !4
Bayes’ Rule
P (B|Ai )P (Ai )
P (Ai |B) =
P (B|A1 )P (A1 ) + . . . + P (B|An )P (An )
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !6
Bayes’ Rule Continued
P (B|A)P (A)
P (A|B) =
P (B)
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !7
So will our flight be on time?
On Time?
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !8
Naïve Bayes Classifiers
• It is called “naive” due to the assumption that the features in the dataset
are mutually independent
• Idea is to factor all available evidence in form of predictors into the naïve
Bayes rule to obtain more accurate probability for class prediction
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !9
Naïve Bayes Classifiers - Pros and Cons
• Advantages
• Requires few examples for training (assuming the data set is a true
representative of the population)
• Dis-advantages
• Not ideal for data sets with large number of numerical attributes
• If rare events are not captured in the training set but appears in the test set
the probability calculation will be incorrect
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !10
Gaussian Naive Bayes classifier
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited !11