Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Read Ch. 8] -Nearest Neighbor Locally weighted regression Radial basis functions Case-based reasoning Lazy and eager learning
k
199
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Instance-Based Learning
Key idea: just store all training examples h ( )i Nearest neighbor: Given query instance , rst locate nearest training example , then estimate ^( ) ( ) -Nearest neighbor: Given , take vote among its nearest nbrs (if discrete-valued target function) take mean of values of nearest nbrs (if real-valued) P ( ) ^( )
x i ; f xi xq xn f xq f xn k xq k f k
k
f xq
i=1
f xi
200
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
201
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Voronoi Diagram
+ xq + + +
202
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
-Nearest neighbor: As number of training examples ! 1 and gets large, approaches Bayes optimal Bayes optimal: if ( ) 5 then predict 1, else 0
p x > :
Note Gibbs has at most twice the expected error of Bayes optimal
203
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Distance-Weighted NN
k
f xq
i=1
wi f x i wi
where
wi
k i=1
and (
d xq ; xi
( ) ) is distance between
d xq ; xi k
xq
and
xi
Note now it makes sense to use all training examples instead of just ! Shepard's method
204
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Curse of Dimensionality
Imagine instances described by 20 attributes, but only 2 are relevant to target function Curse of dimensionality: nearest nbr is easily mislead when high-dimensional One approach: Stretch th axis by weight , where chosen to minimize prediction error Use cross-validation to automatically choose weights Note setting to zero eliminates this dimension altogether
X j zj z1 ; : : : ; z n z1 ; : : : ; z n zj
205
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
k nearest nbrs of
f x
f x
K d xq ; x
:::
206
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
207
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
w0 1
w1
wk
... ...
where ( ) are the attributes describing instance , and ( )= + X ( ( )) One common choice for ( ( )) is
ai x x
k
a 1 (x) a2 (x)
a n (x)
f x
w0
u=1
wu K u d x u ; x
K u d xu ; x e
Ku d xu ; x
((
)) =
? 2 12
2 (x
u ;x)
208
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
209
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Case-Based Reasoning
Can apply instance-based learning even when 6= < ! need di erent \distance" metric
X
n
Case-Based Reasoning is instance-based learning applied to instances with symbolic logic descriptions
((user-complaint error53-on-shutdown) (cpu-model PowerPC) (operating-system Windows) (network-connection PCIA) (memory 48meg) (installed-applications Excel Netscape VirusScan) (disk 1gig) (likely-cause ???))
210
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
211
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
+ C t + + C + f
Q c Q h T T c + +
+ +
Q m
h +
212
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
213
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997
Eager: generalize before seeing query Radial basis function networks, ID3, Backpropagation, NaiveBayes, Does it matter? Eager learner must create global approximation Lazy learner can create many local approximations if they use same , lazy can represent more complex fns (e.g., consider = linear functions)
::: H H
214
lecture slides for textbook Machine Learning, c Tom M. Mitchell, McGraw Hill, 1997