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值使用?這些是根據這些結果用於我的數據集的正確指標。 謝謝。