The silhouette coefficient measures how well each observation fits its assigned cluster compared with its nearest neighboring cluster. It ranges from -1 to +1: higher values indicate stronger cohesion and separation, while low values suggest an unsuitable cluster count. section 11.5.2
Use silhouette coefficients to evaluate candidate cluster counts:
- Compute a coefficient for every data point from within-cluster and nearest-cluster dissimilarities. section 11.5.2
- Prefer configurations where most observations have high or positive coefficients. section 11.5.2
- Plot candidate values of K against silhouette coefficients to identify an optimal cluster count. section 11.5.2
NBA payroll and wins
For standardized NBA team payroll and regular-season wins, compare candidate K-means solutions with factoextra::fviz_nbclust(final_kmeans, kmeans, method = "silhouette"), alongside the within-cluster sum-of-squares method. section 11.5.2
options(scipen = 000) p3 <- fviz_nbclust(final_kmeans, kmeans, method = "wss") p4 <- fviz_nbclust(final_kmeans, kmeans, method = "silhouette")
Run the silhouette and within-cluster sum-of-squares evaluations in R. section 11.5.2

