我可以使用以前Kmeans拟合中的 cluster_center 坐标作为 init 参数,以便在新数据到达时顺序更新 cluster_center 坐标吗?这种方法有什么缺点吗?
更新的 Scikit 在线版本学习 K-means:
KM = KMeans(n_clusters=3, random_state = 200, n_init = 1)
ni = 0
Until interrupted:
for x in data:
KM_updated = KM.fit(x)
Updated_centroids(i) = KM_updated.cluster_centers_(i) + 1/len(KM_updated.labels_(i) + 1) * (x - KM_updated.cluster_centers_(i))
KM = KMeans(n_clusters=3, random_state = 200, init = Updated_centroids(i), n_init = 1)