K-means聚类(K-means Clustering)

交互式Demo(Interactive Demonstration)


"In data mining, k-means clustering is a method of cluster analysis which aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean." - K-means clustering, Baidu

在数据挖掘中,K-means聚类是一种聚类分析方法,旨在将n个观测值划分为k个聚类,每个观测值属于最近均值的聚类。

Use the 2D demonstration below to experiment with the standard Lloyd's algorithm to develop an intuition for the technique. You can try differently generated data, or select Manual to click in your own data points.

使用下面的2D演示来试验标准的Lloyd算法,以培养对这项技术的直觉。你可以尝试不同生成的数据,或选择手动点击输入你自己的数据点。

The algorithm is quite simple. At first a random set of cluster centres is initiated. Points are then assigned to their nearest centre. Centres are adjusted to match the centre of all points assigned to them. The assignment and adjustment steps are repeated until the centres no longer move.

这个算法非常简单。首先,初始化一个随机的聚类中心集。然后,点被分配到最近的中心。中心被调整为所有分配给它们的点的中心。分配和调整步骤重复进行,直到中心不再移动。

K-means Demonstration

Controls


Click and drag circles.
Data Generation
Method:
Points:
Clusters:
constant data cluster size
K-means
Clusters:
show history