Академический Документы
Профессиональный Документы
Культура Документы
Pattern Recognition
Lecture 3
Bayesian Classifier
Syed Fawad Hussain
Bayesian Classifier
Have two dice h1 and h2
The probability of rolling an i given die h1 is denoted P(i|h1).
can be computed as
P( X ) = P( X , Y )
Y
GIK Institute
Basics of Probability
Quiz: We have two six-sided dice. When they are tolled, it could end up
with the following occurance: (A) dice 1 lands on side 3, (B) dice 2
lands on side 1, and (C) Two dice sum to eight. Answer the following
questions:
1) P( A ) = ?
2) P(B) = ?
3) P(C) = ?
4) P( A | B) = ?
5) P(C | A ) = ?
6) P( A , B) = ?
7) P( A , C ) = ?
8) Is P( A , C ) equals P(A) P(C) ?
Syed Fawad Hussain
GIK Institute
Basics of Probability
Bayesian Rule
P( X |C )P(C )
Likelihood Prior
P(C |X ) =
Posterior =
P( X )
Evidence
Syed Fawad Hussain
GIK Institute
Bayes Rule
P ( d | h) P ( h)
p(h | d ) =
P(d )
P(h) :
P(d | h) :
P(h | d ) :
Syed Fawad Hussain
GIK Institute
GIK Institute
GIK Institute
GIK Institute
GIK Institute
Probabilistic Classification
GIK Institute
Bayesian Classification
Bayes classification
P(C |X ) P( X |C )P(C ) = P( X1 , , Xn |C )P(C )
GIK Institute
Bayesian Classification
GIK Institute
NB Example
Total balls = 60
GIK Institute
NB Example
GIK Institute
NB Example
GIK Institute
GIK Institute
Example
Learning Phase
Outlook
Play=Yes
Play=No
Temperature
Play=Yes
Play=No
Sunny
2/9
4/9
3/9
3/5
0/5
2/5
Hot
2/9
4/9
3/9
2/5
2/5
1/5
Overcast
Rain
Humidity
High
Normal
Mild
Cool
Play=Yes Play=No
3/9
6/9
4/5
1/5
P(Play=Yes) = 9/14
Syed Fawad Hussain
Wind
Play=Yes
Play=No
Strong
3/9
6/9
3/5
2/5
Weak
P(Play=No) = 5/14
GIK Institute
Example
Test Phase
P(Outlook=Sunny|Play=Yes) = 2/9
P(Outlook=Sunny|Play=No) = 3/5
P(Temperature=Cool|Play=Yes) = 3/9
P(Temperature=Cool|Play==No) = 1/5
P(Huminity=High|Play=Yes) = 3/9
P(Huminity=High|Play=No) = 4/5
P(Wind=Strong|Play=Yes) = 3/9
P(Wind=Strong|Play=No) = 3/5
P(Play=Yes) = 9/14
P(Play=No) = 5/14
MAP rule