Professional Documents
Culture Documents
Ba Yes I An Learning
Ba Yes I An Learning
1
Machine Learning, Chapter 6 CSE 574, Spring 2003
Data D
Temp Play Tennis
Hot Yes
Cold No
2
Machine Learning, Chapter 6 CSE 574, Spring 2003
3
Machine Learning, Chapter 6 CSE 574, Spring 2003
x0 x1 x2 h0 h1 h2 h255
0 0 0 0 1 0 1
0 0 1 0 0 1 1
0 1 0 0 0 0 1
0 1 1 0 0 0 1
1 0 0 0 0 0 1
1 0 1 0 0 0 1
1 1 0 0 0 0 1
1 1 1 0 0 0 1
4
Machine Learning, Chapter 6 CSE 574, Spring 2003
• Bayes Theorem:
• Method to calculate the posterior probability of h from the
prior probability P(h) together with P(D) and P(D|h)
P ( D | h) P ( h)
P(h | D) =
P( D)
5
Machine Learning, Chapter 6 CSE 574, Spring 2003
P ( D | h) P ( h)
= arg max
h∈H P( D)
7
Machine Learning, Chapter 6 CSE 574, Spring 2003
8
Machine Learning, Chapter 6 CSE 574, Spring 2003
10
Machine Learning, Chapter 6 CSE 574, Spring 2003
11
Machine Learning, Chapter 6 CSE 574, Spring 2003
⎧ 1 if d i = h( xi ) for all d i in D
P ( D | h) = ⎨
⎩0 otherwise
Prob(D/h) 0 0 1 0
1
0.
P(D | h 0 )P(h 0 )
P ( h 0 | D) = = 4 =0
P ( D) 1
4
13
Machine Learning, Chapter 6 CSE 574, Spring 2003
14
Machine Learning, Chapter 6 CSE 574, Spring 2003
1 1
= ∑ 1. + ∑ 0.
hi ∈VS H , D | H | hi ∉VS H ,D | H |
1
= ∑
hi ∈VS H , D
1.
|H |
| VS H , D |
=
|H |
16
Machine Learning, Chapter 6 CSE 574, Spring 2003
⎧ 1
⎪ if h is consistent with D
P (h | D) = ⎨| VS H , D |
⎪⎩ 0 otherwise
17
Machine Learning, Chapter 6 CSE 574, Spring 2003
x0 x1 x2 f0 f1 f2 f3 f4 f255
0 0 0 0 1 0 1 0 1
0 0 1 0 0 1 1 0 1
0 1 0 0 0 0 0 1 1
0 1 1 0 0 0 0 0 1
1 0 0 0 0 0 0 0 1
1 0 1 0 0 0 0 0 1
1 1 0 0 0 0 0 0 1
• Training Data, D
• <(0,0,0),0>
• <(0,0,1),0>
• Hypotheses f0, f4,.. are • Hypotheses f1, f2, f3,.. Are
consistent with D ( there are inconsistent with D
64 such functions)
18
Machine Learning, Chapter 6 CSE 574, Spring 2003
20
Machine Learning, Chapter 6 CSE 574, Spring 2003
22
Machine Learning, Chapter 6 CSE 574, Spring 2003
• Prior knowledge:
• Over entire population only 0.008 have this disease
24
Machine Learning, Chapter 6 CSE 574, Spring 2003
• Known probabilities
• P(cancer)=.008, P(~cancer)=.992
• P(+/cancer)=.98, P(-/cancer)=.02
• P(+/~cancer)=.03, P(-/~cancer)=.97
25
Machine Learning, Chapter 6 CSE 574, Spring 2003
• Known Probabilities
• P(+/cancer)=.98, P(-/cancer)=.02
• P(+/~cancer)=.03, P(-/~cancer)=.97 Lab-test Cancer-Present
Positive 0.98
• P(cancer)=.008, P(~cancer)=.992 Negative 0.02
Lab-test Cancer-Absent
Positive 0.03
Negative 0.97
27
Machine Learning, Chapter 6 CSE 574, Spring 2003
Cancer
Present Cancer
Absent
True Positive
+ - Test Value
28
Machine Learning, Chapter 6 CSE 574, Spring 2003
Cancer
Present Cancer
Absent
False Positive
True Positive
+ - Test Value
Decision Threshold
Decision Threshold
Cancer 1
Present Cancer
True Positive
Absent
0
+ - 0 False Positive 1
Test Value
False Positive
True Positive ErrorRate = ( FalsePositive + FalseNegat
30 ive) / 2
Machine Learning, Chapter 6 CSE 574, Spring 2003
Decision Threshold
Cancer 1
Present Cancer
True Positive
Absent
0
+ - 0 False Positive 1
Test Value
False Positive
True Positive 31
ErrorRate = ( FalsePositive + FalseNegative) / 2
Machine Learning, Chapter 6 CSE 574, Spring 2003
32
Machine Learning, Chapter 6 CSE 574, Spring 2003
x0 vj
x1
x2
fi
P ( x 0 , x1 , x 2 | 0 ) P ( 0 )
P ( 0 | x 0 , x1 , x 2 ) =
P ( x 0 , x1 , x 2 )
P ( x 0 , x1 , x 2 | 1) P (1)
P (1 | x 0 , x1 , x 2 ) =
P ( x 0 , x1 , x 2 )
35
Machine Learning, Chapter 6 CSE 574, Spring 2003
P ( x 0 , x1 , x 2 | 0 ) P ( x 0 , x1 , x 2 | 1)
x0 x1 x2 Prob(0) x0 x1 x2 Prob(1)
0 0 0 0.1 0 0 0 0.05
0 0 1 0.05 0 0 1 0.1
0 1 0 0.1 0 1 0 0.25
0 1 1 0.25 0 1 1 0.25
1 0 0 0.3 1 0 0 0.1
1 0 1 0.1 1 0 1 0.1
1 1 0 0.05 1 1 0 0.15
1 1 1 0.05 1 1 1 0.05
36
Machine Learning, Chapter 6 CSE 574, Spring 2003
P ( x 0 , x1 , x 2 | 0 ) P ( x 0 , x1 , x 2 | 1)
37
Machine Learning, Chapter 6 CSE 574, Spring 2003