2021年4月3日星期六

Silhouette coefficient calculation for clustering

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]  
https://stackoverflow.com/questions/66936649/silhouette-coefficient-calculation-for-clustering April 04, 2021 at 07:10AM

没有评论:

发表评论