Silhouette coefficient calculation for clustering

123 Views Asked by At

I am trying to cluster without using library function, I am trying to validate the clustering technique using Silhouette Coefficient.

valuek = list()
silhouettelist = list()
label = list()
for k in range(2,23,2):
    c_list, c_info = bisectingKMeans(Xsvd,k,10)
    for v in c_info[:, 0]+1:
        label.append((int(v.A[0][0])))
    valuek.append(k)
    silhouettelist.append(metrics.silhouette_score(X_principal, label))

The input data matrix is (8580, 126356). Dimensionality reduction was done using SVD with 200 components. When I tried to use the above mentioned code for calculating silhouette coefficient

I get value error. What should be done to overcome this error?

Found input variables with inconsistent numbers of samples: [8580, 17160]
0

There are 0 best solutions below