Documente Academic
Documente Profesional
Documente Cultură
Bayesian Classifiers
Bayes Classifier
● Given:
– A doctor knows that meningitis causes s tiff neck 50% of the
time
– Prior probability of any patient having meningitis is 1/50,000
– Prior probability of any patient having stiff neck is 1/20
● Approach:
– compute posterior probability P(Y | X1, X2, …, Xd) using
the Bayes theorem
P( X 1 X 2 ! X d | Y ) P(Y )
P(Y | X 1 X 2 ! X n ) =
P( X 1 X 2 ! X d )
– Now we can estimate P(Xi| Yj) for all Xi and Yj
combinations from the training data
– New point is classified to Yj if P(Yj) Π P(Xi| Yj) is
maximal.
P(Refund=Yes|Yes)=0
02/14/2018 Introduction to Data Mining, 2nd Edition 11
1 −
( 120 −110 ) 2
Name Give Birth Can Fly Live in Water Have Legs Class
human yes no no yes mammals A: attributes
python no no no no non-mammals M: mammals
salmon no no yes no non-mammals
whale yes no yes no mammals N: non-mammals
frog no no sometimes yes non-mammals
komodo no no no yes non-mammals
6 6 2 2
bat yes yes no yes mammals P ( A | M ) = × × × = 0.06
pigeon
cat
no
yes
yes
no
no
no
yes
yes
non-mammals
mammals
7 7 7 7
leopard shark yes no yes no non-mammals 1 10 3 4
turtle no no sometimes yes non-mammals P ( A | N ) = × × × = 0.0042
penguin no no sometimes yes non-mammals 13 13 13 13
porcupine yes no no yes mammals
eel no no yes no non-mammals 7
salamander no no sometimes yes non-mammals P ( A | M ) P ( M ) = 0.06 × = 0.021
gila monster no no no yes non-mammals 20
platypus no no no yes mammals
owl no yes no yes non-mammals 13
dolphin yes no yes no mammals P ( A | N ) P ( N ) = 0.004 × = 0.0027
eagle no yes no yes non-mammals 20
Give Birth Can Fly Live in Water Have Legs Class P(A|M)P(M) > P(A|N)P(N)
yes no yes no ? => Mammals
Naïve Bayes
Y = 1 1 1 1 0
Y = 2 0 1 0 0
Y = 3 0 0 1 1
Y = 4 0 0 1 1
X = 1 X = 2 X = 3 X = 4
D
D is parent of C
A is child of C
C
B is descendant of D
D is ancestor of A
A B
Conditional Independence
X1 X2 X3 X4 ... Xd
Exercise Diet
Blood
Chest Pain
Pressure