k-Means (Algorithm)
To perform k-Means Clustering:
- Select points as initial cluster means (cluster centroids)
- Assign each point in the data to the cluster with the closest centroid.
- When all points have been assigned, recalculate the positions of the centroids.
- Repeat steps and until centroids no longer change.
Link to original
Example Iterations
| First Iteration | Further Iterations |
|---|---|
![]() | ![]() |
Advantages and Disadvantages
| Advantages | Disadvantages |
|---|---|
| Simple | Cannot handle non-globular data or data that does not have a centre |
| Can be used for a variety of data types | Need to specify in advance |
| Efficient | Has trouble clustering data with outliers |
Example



