Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proof that k-means always converges?

Tags:

k-means

I understand k-means algorithms steps. However I'm not sure if the algorithm will always converge? Or can the observations always switch from one centroid to another?

like image 902
NickGart Avatar asked Nov 08 '15 13:11

NickGart


People also ask

Does Kmeans always converge?

The algorithm always converges (by-definition) but not necessarily to global optimum. The algorithm may switch from centroid to centroid but this is a parameter of the algorithm ( precision , or delta ). This is sometimes refered as "cycling". The algorithm after a while cycles through centroids.

Will k-means always converge and does it always converge to the global minima?

We previously mentioned that the k-means algorithm doesn't necessarily converge to the global minima and instead may converge to a local minima (i.e. k-means is not guaranteed to find the best solution). In fact, depending on which values we choose for our initial centroids we may obtain differing results.

Does k-means always give the same output?

The K-means algorithm is non-deterministic. This means that the outcome of clustering can be different each time the algorithm is run even on the same data set.


1 Answers

The algorithm always converges (by-definition) but not necessarily to global optimum.

The algorithm may switch from centroid to centroid but this is a parameter of the algorithm (precision, or delta). This is sometimes refered as "cycling". The algorithm after a while cycles through centroids. There are two solutions (which both can be used at the same time). Precision parameter, maximum number of iterations parameter.

Precision parameter, if centroids amount of change is less than a threshold delta, stop the algorithm.

Max Num Iterations, if algorithm reaches that number of iterations stop the algorithm.

Note that the above schemes do not spoil the convergence characteristics of the algorithm. it still will converge but not necessarily to global optimum (this is irrelevant of the scheme used, as in many optimisation algorithms).

You may be interested in the related question on stats.SE Cycling in k-means algorithm and a referenced proof of convergence

like image 90
Nikos M. Avatar answered Oct 05 '22 13:10

Nikos M.