Nearest-Neighbor Classifiers requires three things
- The set of stored records
- Distance Metric to compute distance between records
- The value of k, the number of nearest neighbors to retrieve
To classify an unknown record:
- Compute distance to other training records
- Identify k nearest neighbors
- Use class labels of nearest neighbors to determine the class label of unknown record (e.g., by taking majority vote)
Definition of Nearest Neighbor
K-nearest neighbors of a record x are data points that have the k smallest distance to x
1-nearest-neighbor
Nearest Neighbor Classification
Compute distance between two points:
- Euclidean distance
- Manhatten distance
- q norm distance