Knn |
Kmeans |
1.KNN is a classification algorithm 2. Supervised learning 3. The data given to it is a label, which has been sorted out in advance, The number of categories does not change. |
1.kmeans is a clustering algorithm 2. Non-supervised learning 3. The data given to it is no label, it is not sorted in advance, Clustered into clusters with the principle of "flock together". |
There is no obvious pre-training process. |
There is a clear pre-training process. |
K Meaning: A sample of X, to classify it, that is, to find out its category, from the data set, Find the nearest K-point location near X, which has the largest number of K-locations, Just set the X category to C. |
K means: K is a manually fixed number, assuming that the data set can be Divided into K-clusters, because it is based on artificial, need a bit of prior knowledge |
The above is the difference between KNN and Kmeans, the same point: similarities: all include such a process, given a point, in the data set to find the nearest point. That is, both use the NN (nears Neighbor) algorithm, generally using KD tree to achieve nn.
The difference between KNN and Kmeans algorithm