You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

K-means因初始质心随机结果可变,k=1时是否总能得到数据重心?

K-means with k=1: Will It Always Return the Dataset's Barycentre?

Short answer: Yes, 100% of the time—no matter what initial centroid you pick, K-means will end up converging to the global mean (barycentre) of your dataset.

Let me break down why this works, step by step:

  • When k=1, every data point gets assigned to the single cluster, regardless of where the initial centroid is placed.
  • The algorithm then recalculates the centroid as the mean of all points in the cluster (which is every point in your dataset). This becomes the new centroid.
  • In the next iteration, since all points are still assigned to this single cluster, recalculating the centroid will give exactly the same mean value. The algorithm detects the centroid hasn't changed and stops.

There's zero room for varying outcomes here because:

  • The K-means objective function (minimizing within-cluster sum of squared errors, WCSS) has a unique minimum when k=1. That minimum is achieved exactly when the centroid is the dataset's global mean—there are no local minima to get stuck in, unlike when k>1.
  • Even if you start with an initial centroid way outside your dataset (like a random point nowhere near your data), the first update will immediately jump to the barycentre, and then stay there.

In short, k=1 is the only case where K-means is completely deterministic, no matter what initial conditions you use.

内容的提问来源于stack exchange,提问作者user

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 09:26:50