Professional Documents
Culture Documents
Naive Bayes Classifier
Naive Bayes Classifier
Naive Bayes Classifier
Ke Chen
http://intranet.cs.man.ac.uk/mlo/comp20411/
• Bayesian Rule
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 )
[ P( x1 |c * ) P( xn |c * )]P(c * ) [ P( x1 |c ) P( xn |c)]P(c ), c c * , c c1 , , c L
– MAP rule
Probabilitas kemunculan setiap nilai untuk Probabilitas kemunculan setiap nilai untuk
atribut Ada Angkutan Umum (C3) atribut Dipilih untuk perumahan (C4
20
Relevant Issues
• Violation of Independence Assumption
– For many real world tasks, P( X1 , , Xn |C ) P( X1 |C ) P( Xn |C )
– Nevertheless, naïve Bayes works surprisingly well anyway!
• Zero conditional probability Problem
– If no example contains the attribute value X j a jk , Pˆ ( X j a jk |C ci ) 0
– In this circumstance, Pˆ ( x |c ) Pˆ ( a |c ) Pˆ ( x |c ) 0 during test
1 i jk i n i
– For a remedy, conditional probabilities estimated with
n mp
Pˆ ( X j a jk |C ci ) c
nm
nc : number of trainingexamples for which X j a jk and C ci
n : number of trainingexamples for which C ci
p : prior estimate (usually, p 1 / t for t possiblevalues of X j )
m : weight to prior (number of " virtual" examples, m 1)
COMP20411 Machine Learning 21
Relevant Issues
• Continuous-valued Input Attributes
– Numberless values for an attribute
– Conditional probability modeled with the normal distribution
1 ( X j ji )2
Pˆ ( X j |C ci ) exp
2 ji 2 ji2
ji : mean (avearage) of attribute values X j of examples for which C ci
ji : standarddeviation of attribute values X j of examples for which C ci
• Dari tabel tersebut, serta tentukan mobil dengan warna merah, tipe SUV, dan asal
domestik tersebut tercuri atau tidak?