K-Nearest Neighbor
K-Nearest Neighbor
LECTURE
Classification
k-nearest neighbor classifier
What is classification?
• Classification is the task of learning a target function f that
maps attribute set x to one of the predefined class labels y
Training Set
Apply
Tid Attrib1 Attrib2 Attrib3 Class Model
11 No Small 55K ?
12 Yes Medium 80K ?
13 Yes Large 110K ? Deduction
14 No Small 95K ?
15 No Large 67K ?
10
Test Set
Nearest neighbor classification
Nearest Neighbor Classifiers
Set of Stored Cases • Store the training records
Compute
Distance Test
Record
X X X