liveBook · Manning

Silhouette coefficient

As explained in Statistics Slam Dunk

A silhouette coefficient measures an observation's relative cohesion within its assigned cluster and separation from the nearest other cluster, typically ranging from -1 to +1.

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

How Statistics Slam Dunk covers it

How deep it goes
Defines and derives the coefficient from dissimilarities, then uses plotted values to choose K without discussing implementation internals.
Examples
Evaluates NBA team clusters formed from standardized payroll and regular-season wins.
What it assumes
Builds on clustering, K-means, cluster counts, and within- and between-cluster dissimilarity.
What you can do after
Apply it via factoextra's fviz_nbclust() to compare candidate cluster counts in R.
How it connects
Connects K-means clustering, the elbow method, within-cluster sum of squares, and dissimilarity.

Also explained in

Compare how 2 books explain silhouette coefficient →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.