Introduction - If you have any usage issues, please Google them yourself
The basic idea is that neighbors in a test sample x, k-nearest neighbor in categories according to the sample appears as a type of x, ie the first k nearest neighbors of x, find them a category and then determine categories of x, ie In the N training samples, find x, k-nearest neighbor.