# k-means with several repetitions

In matlab and python, when running k-means, it is possible to set several repetitions (with random init) so that all of them in the end are combined to have stable global result? I am wondering how these several outputs are combined? If they have different inits then it can happen that the corresponding cluster labels between different runs are different. How are they combined, then?

• What do you mean by "stable global result?" The only information you could get by combining clusters is the overall "distribution" of centroids for a given group. By definition however, making any switch for a given centroid assignment will make the assignment worse for a given solution to k-means Oct 22 '15 at 21:12
• By this I mean converging to the global maximum instead of local one that could be the case for the stand-alone k-means. Oct 22 '15 at 21:27
• It's not so easy to converge to the global maximum. The optimization is nonlinear, and sampling twice with the usual random algorithm will in no way "converge" to the global min. The state space grows exponentially: when you have $g$ groups and $k$ clusters, there are $g^k$ possible assignments. Oct 22 '15 at 22:38
• Thanks for the explanation. Ok, lets not use "global maximum" for this. But my main question was how do they combine the clustering results? Oct 23 '15 at 9:33