Naive Bayes
Naive Bayes
Ke Chen
http://intranet.cs.man.ac.uk/mlo/comp20411/
P(x)
C1
C2
0
Slide by Stephen Marsland
x
Naïve Bayes
• Bayes classification
P(C|X) P(X|C)P(C) = P(X1 , , Xn |C)P(C)
Difficulty: learning the joint probability P(X1 , , Xn |C)
• Naïve Bayes classification
– Making the assumption that all input attributes are independent
P( X1 , X2 , , Xn |C ) = P( X1 | X2 , , Xn ; C )P( X2 , , Xn |C )
= P( X1 |C )P( X2 , , Xn |C )
= P( X1 |C )P( X2 |C ) P( Xn |C )
– MAP classification rule
[ P( x1 |c* ) P( xn |c* )]P(c* ) [ P( x1 |c) P( xn |c)]P(c), c c* , c = c1 , , cL
– MAP rule
P(Yes|x’): [P(Sunny|Yes)P(Cool|Yes)P(High|Yes)P(Strong|Yes)]P(Play=Yes) = 0.0053
P(No|x’): [P(Sunny|No) P(Cool|No)P(High|No)P(Strong|No)]P(Play=No) = 0.0206