Grade K means clustering using python

I have a dataset a bit like this:

enter image description here

I performed K clustering using this code:

from scipy.cluster.vq import kmeans, vq
data=np.matrix(dataAll.ix[:,:-1])
centers, _ = kmeans(data, 3, iter=100)
cluster, _ = vq(data, centers)

Here I want to ask how to evaluate k means clustering . I want to get such a value as accuracy, accuracy, f measures .

+4
source share
1 answer

If you have Gold / Ground true, you can use my [ Link ] code to calculate pairwise accuracy, challenge, FScore and NMI.

, , , . [ Matlab Python] python , .

0

All Articles