Lecture 12
Lecture 12
CSE-4075
(K-Nearest Neighbor)
If you want to annoy your neighbors, tell the truth
about them.
Pietro Aretino
Different Learning Methods
• Eager Learning
– Explicit description of target function on the
whole training set
• Instance-based Learning
– Learning=storing all training instances
– Classification=assigning target function to a new
instance
– Referred to as “Lazy” learning
Eager Learning
I saw a mouse!
Instance-based Learning
• Supervised learning
WHY NEAREST NEIGHBOR?
• Used to classify objects based on closest training
examples in the feature space
– Feature space: raw data transformed into sample
vectors of fixed length using feature extraction
(Training Data)
• Top 10 Data Mining Algorithm
– ICDM paper – December 2007
• Among the simplest of all Data Mining Algorithms
– Classification Method
• Implementation of lazy learner ? 9
x1
x
2
d
x .. d
xy i i
(x y ) 2
.. i1
x
d
K NEAREST NEIGHBOR
k = 1:
Belongs to square class
k = 3:
? Belongs to triangle class
k = 7:
Belongs to square class
¿
Parameters:
Distance Metric= Euclidean Distance
Nearest Neighbors =K= 3