K nearest neighbor method pattern recognition PYTH
no vote
Application background The nearest neighbor rule belongs to template matching in principle. The training samples of each sample as template, the comparison with the test sample and each template, see what templates with most similar (nearest neighbor), according to the most similar to the template category as a category of its own. a clear extension of the nearest neighbor method is K- nearest neighbor method. From the meaning of words, the method is to take the unknown sample x k nearest neighbor, see the k nearest neighbors in majority belongs to which category, put x belong to which category.