k-means: Same clusters for every execution

前端 未结 2 2097
灰色年华
灰色年华 2021-01-03 02:05

Is it possible to get same kmeans clusters for every execution for a particular data set. Just like for a random value we can use a fixed seed. Is it possible to stop random

2条回答
  •  悲&欢浪女
    2021-01-03 02:46

    Yes, calling set.seed(foo) immediately prior to running kmeans(....) will give the same random start and hence the same clustering each time. foo is a seed, like 42 or some other numeric value.

提交回复
热议问题