1
如果我們將K-means和連續K-means方法應用於具有相同初始設置的相同數據集,我們是否會得到相同的結果?解釋你的理由。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-means
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
由反例所證明的案例如此關閉+1 –
理解,謝謝。 –