K-means ++算法

时间:2013-07-05 01:38:12

标签: algorithm

我阅读了论文k-means++: The Advantages of Careful Seeding并且不太了解提供的算法:

“设D(x)表示从数据点x到我们已选择的最近中心的最短距离。

1a上。随机选择一个初始中心c1 来自X。

1b中。选择下一个中心ci,用概率选择ci =x'∈X(D(x')^ 2)/ Sum_of(D(x)^ 2)

1c上。重复步骤1b,直到我们选择了总共k个中心。

2-4。继续使用标准k-means算法“

(最好看看上面链接中的算法)

特别是第1b步。它们的意思是“用概率选择ci =x'∈X(D(x')^ 2)/ Sumof(D(x)^ 2)”。他们是指选择比例最大的元素吗?如何进行这样的计算可以导致选择最佳质心?

3 个答案:

答案 0 :(得分:5)

为所有点x∈X定义函数 D(x)

在步骤1b中,我们必须选择一些点作为新的中心。我们将在所有点(不是中心点)之间随机选择。但我们不会给予每一点平等的机会;我们会在选择之前为不同的点分配不同的概率。这些概率必须加起来为1。

考虑D(x)^ 2。我们可以在每个点对此进行评估,并将值相加:Sum_of(D(x)^ 2)。

然后我们可以为每个点x'分配等于D(x')^ 2 / Sum_of(D(x)^ 2)的概率。这些概率加起来为1,并且提供了一个更好的机会来远离所有现有的中心。

答案 1 :(得分:0)

http://en.wikipedia.org/wiki/K-means%2B%2B

   1. Choose one center uniformly at random from among the data points.
   2. For each data point x, compute D(x), the distance between x and the nearest center that has already been chosen.
   3. Choose one new data point at random as a new center, using a weighted probability distribution where a point x is chosen with probability proportional to D(x)2.
   4. Repeat Steps 2 and 3 until k centers have been chosen.
   5. Now that the initial centers have been chosen, proceed using standard k-means clustering.

答案 2 :(得分:0)

K-Means和K-Means ++之间最大的区别是选择初始中心的方式。 K均值随机选择初始中心。在选择初始中心之前,K-Menas ++会计算点与第一个中心之间的所有距离,以使所有中心 会被选择为彼此远离。如果一个中心在其他中心附近,则分配给相应中心的点需要进行多次迭代以分离群集。但是,如果两个中心的距离足够远,则它们属于一个群集的可能性很小,并且很容易将群集分离。

相关问题