Professional Documents
Culture Documents
Naive02 Bayesian
Naive02 Bayesian
to N
c ti on
u
i n trod eory e w ’s
t h t h dr
i n-dep nd the see An ers.
e a se ta Min
mor sifiers
Naïve Bayes
a p l e a a
For s Clas them, y for D
e t
Bay unding obabili
o r
surr re on P
Classifiers
u
l ec t
C Z R
J Person is a Junior
C Brought Coat to Classroom
Z Live in zipcode 15213
R Saw “Return of the King” more than once
Copyright © 2004, Andrew W. Moore Slide 2
A simple Bayes Net
J What parameters are
stored in the CPTs of
this Bayes Net?
C Z R
J Person is a Junior
C Brought Coat to Classroom
Z Live in zipcode 15213
R Saw “Return of the King” more than once
Copyright © 2004, Andrew W. Moore Slide 3
A simple Bayes Net
P(J) =
J J Person is a Junior
C Brought Coat to Classroom
Z Live in zipcode 15213
R Saw “Return of the King” more
than once
C Z R
P(Z|J) = P(R|J) =
P(C|J) =
P(Z|~J)= P(R|~J)=
P(C|~J)=
2 0 p eople
a b a s e from u se
a d a t ld w e
w e have H o w co u
Suppo s e
a le c t ur e .
in t h is CPT?
ho a t t ended t h e v alues
w s t im a te
o e
that t
Copyright © 2004, Andrew W. Moore Slide 4
A simple Bayes Net
P(J) =
J J Person is a Junior
C Brought Coat to Classroom
# people who walked to school
Z Live in zipcode 15213
R# people in database
Saw “Return of the King” more
than once
C F R
# people who walked to school and brought a coat
# people who walked to school
P(Z|J) = P(R|J) =
P(C|J) =
P(Z|~J)= P(R|~J)=
P(C|~J)=
2 0 p eople
a b a s e from u se
a d a t ld w e
w e ve t walkHoto
hadidn' co u
w school
# coat - bringers
Suppo s e who
a le c t ur e .
in t h is CPT?
o a t t e nded t h e v a lues
# people h
w who didn' t im te
tawalk to school
o e s
that t
Copyright © 2004, Andrew W. Moore Slide 5
A Naïve Bayes Classifier
P(J) =
J Output Attribute
J Walked to School
C Brought Coat to Classroom
Z Live in zipcode 15213
R Saw “Return of the King” more
than once
C Z R
P(Z|J) = P(R|J) =
Input Attributes
P(C|J) =
P(Z|~J)= P(R|~J)=
P(C|~J)=
A new person shows up at class wearing an “I live right above the
Manor Theater where I saw all the Lord of The Rings Movies every
night” overcoat.
What is the probability that they are a Junior?
Copyright © 2004, Andrew W. Moore Slide 6
Naïve Bayes Classifier Inference
J
P ( J | C ^ ¬Z ^ R ) =
P ( J ^ C ^ ¬Z ^ R )
=
C Z R
P(C ^ ¬Z ^ R)
P ( J ^ C ^ ¬Z ^ R )
=
P ( J ^ C ^ ¬Z ^ R ) + P ( ¬J ^ C ^ ¬Z ^ R )
P(C | J ) P(¬Z | J ) P ( R | J ) P ( J )
=
⎛ P(C | J ) P(¬Z | J ) P ( R | J ) P ( J )
⎞
⎜ ⎟
⎜ + ⎟
⎜ P (C | ¬J ) P(¬Z | ¬J ) P ( R | ¬J ) P(¬J ) ⎟
⎝ ⎠
Copyright © 2004, Andrew W. Moore Slide 7
The General Case
Y
X1 X2 ... Xm