k-Means (Algorithm)

To perform k-Means Clustering:

  1. Select points as initial cluster means (cluster centroids)
  2. Assign each point in the data to the cluster with the closest centroid.
  3. When all points have been assigned, recalculate the positions of the centroids.
  4. Repeat steps and until centroids no longer change.

Link to original

Example Iterations

First IterationFurther Iterations

Advantages and Disadvantages

AdvantagesDisadvantages
SimpleCannot handle non-globular data or data that does not have a centre
Can be used for a variety of data typesNeed to specify in advance
EfficientHas trouble clustering data with outliers

Example