Nearest-Neighbor Classifier in Artificial intelligence

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)
Nearest-Neighbor Classifiers
Nearest-Neighbor Classifiers

Definition of Nearest Neighbor

Nearest Neighbor
Nearest Neighbor

K-nearest neighbors of a record x are data points that have the k smallest distance to x

1-nearest-neighbor

Voronoi Diagram
Voronoi Diagram

Nearest Neighbor Classification

Compute distance between two points:

  • Euclidean distance
Euclidean distance
Euclidean distance
  • Manhatten distance
Manhatten distance
Manhatten distance
  • q norm distance
q norm distance
q norm distance

Leave a Comment