cuốn sách gpt4 ai đã làm

Kết quả của K-mean và K-mean tuần tự có giống nhau không?

In lại Tác giả: Taklimakan 更新时间:2023-11-03 04:19:54 34 4
mua khóa gpt4 Nike

如果我们将 K-means 和顺序 K-means 方法应用于具有相同初始设置的相同数据集,我们会得到相同的结果吗?解释你的理由。

个人认为答案是否定的,顺序K-means得到的结果取决于数据点的呈现顺序。而且结束条件也不一样。

这里附上两种聚类算法的伪代码。

K-均值

Make initial guesses for the means m1, m2, ..., mk
Until there is no change in any mean
Assign each data point to the cluster whose mean is the nearest.
Calculate the mean of each cluster.
For i from 1 to k
Replace mi with the mean of all examples for cluster i.
end_for
end_until

顺序 K 均值

Make initial guesses for the means m1, m2, ..., mk
Set the counts n1, n2, ..., nk to zero
Until interrupted
Acquire the next example, x
If mi is closest to x
Increment ni
Replace mi by mi + (1/ni)*(x - mi)
end_if
end_until

câu trả lời hay nhất

正确,结果可能不同。

点:x1 = (0,0), x2 = (1,1), x3 = (0.75,0), x4 = (0.25,1); m1 = (0,0.5),m2 = (1,0.5)。 K-means 将 x1 和 x4 分配给 m1-cluster,x2 和 x3 分配给 m2-cluster。新均值是 m1' = (0.125,0.5) 和 m2' = (0.875,0.5),并且不会发生重新分配。使用顺序 K-means,在分配 x1 后,m1 移动到 (0,0),x2 将 m2 移动到 (1,1)。然后 m1 最接近 x3 的平均值,因此 m1 移动到 (0.375,0)。最后,m2 最接近 x4,因此 m2 移动到 (0.625,1)。这又是一个稳定的配置。

关于algorithm - K-means 和顺序 K-means 的结果相同吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8351296/

34 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress