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)