K-means is considered an unsupervised learning method because the algorithm is not told what the correct clusters are; it must infer the clusters from the data alone.
The k-means algorithm begins by choosing k centroids at random. Then, it alternates between the following two steps:
Update clusters. Group the restaurants into clusters, where each cluster contains all restaurants that are closest to the same centroid. In this step, centroid positions remain the same, but which cluster each restaurant belongs to can change.
Update centroids. Compute a new centroid (average position) for each new cluster. In this step, restaurant clusters remain the same, but the centroid positions can move.
可视化链接:http://tech.nitoyon.com/en/blog/2013/11/07/k-means/