"Machine learning" K-mean Algorithm (II)

Source: Internet
Author: User

How to choose where to initialize the cluster center in K clustering algorithm.

When choosing a cluster center, it may not be possible to derive the local optimal solution we want if the initialization position is not appropriate.

Instead, there is a situation:

To solve this problem, our usual practice is to:

We select K<m Cluster Center.

Then we randomly select the examples of k training samples, and then make the K cluster centers equal to the K training instances respectively.

After that we usually need to run the mean algorithm multiple times. Each time it is reinitialized, and then the result of comparing the K-mean values running multiple times, the result of selecting a lower cost function. This method may be effective when the k is small, but there will be no noticeable improvement in the number of K.

How to select the number of clusters

When we study the relationship between the number of clusters and the J of the distortion function, we find that the "elbow law", that is, when the number of k increases gradually, there is a certain point in the J function of the descent process of inflection.

Before this point, the value of his distortion drops rapidly, and after this point, its distortion value slows down, so it seems that the inflection points will usually be the most appropriate value. However, in the actual situation, we will choose the number of K value depends on the clustering algorithm needs to solve the actual problem of the purpose. Select the number of K values according to the actual needs.

"Machine learning" K-mean Algorithm (II)

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.