The generalization of the nearest neighbor algorithm, k nearest neighbor, finds the k most similar data points T k to x and assigns x the labelŷ such that:ŷ = arg max Euclidean distance and || • || = 1 if the argument is true (else 0).
the k most similar points take a weighted vote on the class of x.