Question: silhouette _ coefficients = [ ] for k in range ( 2 , 1 1 ) : kmeans = KMeans ( n _ clusters =
silhouettecoefficients
for in range :
kmeans KMeans clusters randomstate
kmeans.fit pcadf
score silhouettescore pcadf kmeans.labels
silhouettecoefficients.append score
# Plotting the results:
pltplot range silhouettecoefficients
pltxticks range
pltxlabel Number of Clusters"
pltylabel Silhouette Coefficient"
pltgridTrue
pltshow From the PCA silhouettecoefficients plotting, how many clusters are suggested?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
