Lazy Learning (Or Learning From Your Neighbors)
Lazy Learning (Or Learning From Your Neighbors)
–Case-based reasoning
k-Nearest-Neighbor Method
–It has since been widely used in the area of pattern recognition.
–A k-nearest-neighbor classifier searches the pattern space for the k training instances that are
closest to the unknown instance.
Requires 3 things:
o Feature Space (Training Data)
o Distance metric
to compute distance between records
o The value of k
the number of nearest neighbors to retrieve from which to get
majority class
To classify an unknown record:
o Compute distance to other training records
o Identify k nearest neighbors
o Use class labels of nearest neighbors to determine the class label of unknown
record
k = 1:
k = 3:
k = 7:
Examples
Name Acid Durability Strength class
Type-1 7 7 Bad
Type-2 7 4 Bad
Type-3 3 4 Good
Type-4 1 4 Good
Test – data -----> acid durability = 3 , and strength = 7 , class= ?
Calculated using distance measure