Below is a visual representation of the K-means clustering algorithm. This is an unsupervised machine learning algorithm that attempts to group a set of (unlabeled) data points into clusters according to proximity.
The algorithm first initializes a set of K "centroids", which are to be the geometric centers of the data clusters. Then, there is a repeating loop that has two main steps:
Instructions for this demonstration: the data used here consists of 75 randomly selected points in the plane, and the algorithm tries to group those points into 5 clusters. The centroids are initialized randomly. Press "Iterate" to step through one iteration of the algorithm. You can see how the centroids move, and how data may move from one cluster to another (by changing color). Press "Reset" to reset data and clusters.