0
我试图使用Elbow和BIC方法估算Kmeans中K的数量.X是多维数据点数组(100000个数据点X 100个特征)
这里是我用于弯头:用于估算Kmeans中K值的度量标准
Ks = [40,50,60,70,80,90,100,110,120]
ds = []
for K in Ks:
cls = MiniBatchKMeans(K, batch_size =1000, random_state = 101)
for i in xrange(0, len(X), 1000):
chunk = newvec[i:i + 1000]
cls.partial_fit(chunk)
ds.append(cls.inertia_)
plt.plot(Ks, ds)
plt.xlabel('Value of K')
plt.ylabel('Distortion')
plt.show()
我使用的BIC代码是从这里by Prabhath Nanisetty
什么是正确的K值使用?这些是根据这些结果用于我的数据集的正确指标。 谢谢。