The difference between KNN and Kmeans algorithm

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.