What Silhouette Score Measures
The silhouette score answers a per-point question: is this data point closer to its own cluster or to the nearest neighboring cluster? Unlike the Calinski-Harabasz index, which produces one number for the entire clustering, the silhouette score computes a value for every individual point, revealing exactly where cluster assignments are strong and where they break down. Proposed by Peter Rousseeuw in 1987, it remains one of the most widely used internal clustering evaluation metrics precisely because of this granularity.
Each point's score ranges from −1 to +1. A score near +1 means the point is deep inside its cluster, far from any neighbor. Near 0 means it sits on the boundary between two clusters. Below 0 means the point is likely assigned to the wrong cluster — it is actually closer to a different cluster on average. This per-point granularity is the silhouette's defining advantage.
Mathematical Definition
For a point x_i in cluster C_k:
This is the average distance to all other points in the same cluster — the intra-cluster distance.
This is the average distance to points in the nearest other cluster — the nearest-cluster distance.
The silhouette score for point x_i is:
The overall silhouette score is the mean across all points: S = \frac{1}{n} \sum_{i=1}^{n} s(i).
Exploring Silhouette Interactively
Each point is colored by its silhouette score — teal for confident assignments, red for potential misclassifications. Switch between presets to see how cluster geometry affects per-point scores.
Silhouette Score Explorer
Each point is colored by its individual silhouette score — teal for well-assigned, red for potentially misclassified.
Anatomy of a Single Point's Score
The power of the silhouette lies in its per-point decomposition. For any point, you can trace exactly why it scores well or poorly by examining its two distances. A core point deep inside a tight cluster will have small a (nearby same-cluster neighbors) and large b (distant other-cluster points), yielding s close to 1. A boundary point will have similar a and b, yielding s near 0. A misclassified point will have a > b — it is closer to the wrong cluster.
This decomposition makes silhouette uniquely useful for debugging. When a clustering produces a mediocre average score, you can inspect the worst-scoring points to understand whether the problem is boundary ambiguity, cluster overlap, or outright misassignment. No other standard internal metric provides this level of diagnostic detail.
Click a Point to Explore
Click any point to see its silhouette score calculated step by step — blue lines show intra-cluster distances (a), red lines show nearest-cluster distances (b).
Select a point, then step through its calculation.
Silhouette Plots and k-Selection
The silhouette plot is the canonical visualization for this metric. Points are sorted by score within each cluster, producing “knife shapes.” A good clustering shows wide, uniform knives — all clusters have consistently high scores. A poor clustering shows thin, jagged knives with negative tails. The average silhouette across k values ranks the candidate assignments under the selected metric, but the plot's shape matters as much as the number — uniform widths across clusters indicate balanced, well-separated groups.
When using silhouette for k-selection, look beyond the average. A clustering with k = 3 and average silhouette 0.55 where all clusters score uniformly is often preferable to k = 2 with average 0.60 where one cluster scores 0.85 and the other scores 0.35. The plot reveals this imbalance immediately, while the average alone would mislead you into choosing fewer clusters.
The next figure uses the same 40 authored points at every k. Deterministic k-means generates assignments, then the displayed bars and all summaries are calculated from those assignments.
Calculate silhouette across candidate clusterings
The same 40 authored 2D points are clustered at every k. Farthest-first initialization and Lloyd updates are deterministic. These are calculated toy results, not a benchmark or a recovered ground truth.
Colors indicate the calculated assignments; crosses are centroids. Coordinate units are arbitrary.
- Mean silhouette (40 points)
- 0.8209
- Lowest cluster mean
- 0.8170
- Negative point scores
- 0 / 40
Highest candidate score: k=3. This comparison ranks these assignments under this metric; it does not prove the number of meaningful groups.
Each point bar spans −1 at the left edge to +1 at the right; zero is the midpoint. The number is the exact calculated score rounded to three decimals.
Cluster 1: 14 points
Cluster 2: 13 points
Cluster 3: 13 points
Inspect all point coordinates, assignments and distances
| Point | x | y | Cluster | a | b | s |
|---|---|---|---|---|---|---|
| 0 | -2.7500 | -1.0000 | 1 | 0.6817 | 4.8671 | 0.8599 |
| 1 | 2.2272 | -0.7501 | 2 | 0.7260 | 4.3356 | 0.8325 |
| 2 | 0.0428 | 2.5119 | 3 | 0.7533 | 4.3640 | 0.8274 |
| 3 | -2.6289 | -0.5159 | 1 | 0.8602 | 4.4069 | 0.8048 |
| 4 | 1.7812 | -1.1272 | 2 | 0.9613 | 4.4712 | 0.7850 |
| 5 | 0.7172 | 2.5438 | 3 | 0.9787 | 4.0402 | 0.7578 |
| 6 | -3.2518 | -0.0633 | 1 | 1.0899 | 4.4924 | 0.7574 |
| 7 | 2.3848 | -1.2219 | 2 | 0.6596 | 4.8208 | 0.8632 |
| 8 | 0.3475 | 3.1269 | 3 | 0.6828 | 4.7245 | 0.8555 |
| 9 | -3.4529 | -0.8130 | 1 | 0.7641 | 5.1625 | 0.8520 |
| 10 | 2.7585 | -1.5525 | 2 | 0.8236 | 5.2925 | 0.8444 |
| 11 | 0.2185 | 3.6965 | 3 | 0.9288 | 5.2874 | 0.8243 |
| 12 | -3.7354 | -1.4262 | 1 | 1.0169 | 5.8064 | 0.8249 |
| 13 | 3.4474 | -1.2083 | 2 | 1.0568 | 5.4071 | 0.8046 |
| 14 | -0.1438 | 3.2045 | 3 | 0.6576 | 5.0390 | 0.8695 |
| 15 | -3.0475 | -1.3669 | 1 | 0.7263 | 5.3367 | 0.8639 |
| 16 | 2.8747 | -0.6842 | 2 | 0.7579 | 4.6434 | 0.8368 |
| 17 | -0.6095 | 3.0252 | 3 | 0.8629 | 4.6979 | 0.8163 |
| 18 | -2.4826 | -1.5149 | 1 | 0.9706 | 5.0967 | 0.8096 |
| 19 | 2.4607 | -0.1509 | 2 | 1.0736 | 3.9720 | 0.7297 |
| 20 | -0.6215 | 2.2552 | 3 | 1.1493 | 4.0591 | 0.7169 |
| 21 | -2.7522 | -0.9667 | 1 | 0.6815 | 4.8412 | 0.8592 |
| 22 | 2.1963 | -0.7887 | 2 | 0.7250 | 4.3533 | 0.8335 |
| 23 | 0.1075 | 2.5219 | 3 | 0.7494 | 4.3351 | 0.8271 |
| 24 | -2.6967 | -0.4707 | 1 | 0.8545 | 4.4130 | 0.8064 |
| 25 | 1.8045 | -1.2219 | 2 | 0.9605 | 4.5670 | 0.7897 |
| 26 | 0.7716 | 2.6435 | 3 | 0.9798 | 4.1043 | 0.7613 |
| 27 | -3.3745 | -0.1052 | 1 | 1.0879 | 4.6108 | 0.7640 |
| 28 | 2.4154 | -1.2352 | 2 | 0.6581 | 4.8474 | 0.8642 |
| 29 | 0.3275 | 3.1721 | 3 | 0.6837 | 4.7736 | 0.8568 |
| 30 | -3.4738 | -0.8751 | 1 | 0.7646 | 5.2221 | 0.8536 |
| 31 | 2.8299 | -1.5131 | 2 | 0.8172 | 5.2962 | 0.8457 |
| 32 | 0.1236 | 3.7195 | 3 | 0.9338 | 5.3504 | 0.8255 |
| 33 | -3.6720 | -1.5205 | 1 | 1.0219 | 5.8376 | 0.8249 |
| 34 | 3.4667 | -1.0801 | 2 | 1.0586 | 5.3212 | 0.8011 |
| 35 | -0.1698 | 3.1835 | 3 | 0.6588 | 5.0355 | 0.8692 |
| 36 | -2.9982 | -1.3700 | 1 | 0.7271 | 5.3109 | 0.8631 |
| 37 | 2.8292 | -0.6371 | 2 | 0.7625 | 4.5787 | 0.8335 |
| 38 | -0.6074 | 2.9437 | 3 | 0.8604 | 4.6302 | 0.8142 |
| 39 | -2.4185 | -1.4413 | 1 | 0.9723 | 5.0263 | 0.8066 |
Strengths and Limitations
The silhouette score has several meaningful advantages. It uses pairwise distances and supports a chosen metric, but Euclidean silhouette favors compact, convex groups. Pairwise computation does not make it geometry-agnostic. Its per-point scores enable diagnosis of specific misassignments, which helps locate weakly separated assignments. The bounded [-1, +1] range is immediately interpretable without context. And it works with any distance metric — Euclidean, cosine, Manhattan, or custom domain-specific distances.
However, the silhouette has real limitations. Its O(n^2) computation from pairwise distances makes it impractical for datasets above roughly 50,000 points without approximation or sampling. The average silhouette can mask problems — one excellent cluster and one terrible cluster might average to a “decent” score. It does not account for density differences between clusters, so a sparse cluster far from a dense cluster may score well despite poor internal cohesion. And for very high-dimensional data, distance concentration effects can compress the score range, reducing its discriminative power.
A geometry counterexample
For two concentric circles with 200 evenly spaced points on each, radii 1 and 2, the ring labels have Euclidean silhouette about 0.1148. Splitting those same points into left and right halves scores about 0.3522. The metric prefers the compact halves despite the ring structure. This is calculated on synthetic coordinates, not a model benchmark. The scikit-learn clustering guide documents this convexity bias.
Comparing Clustering Metrics
Each internal clustering metric makes different geometric assumptions and trades off speed against diagnostic depth.
Comparing Clustering Metrics
| Property | Calinski-Harabasz | Silhouette Score | Davies-Bouldin |
|---|---|---|---|
| Formula | SS_B / SS_W (normalized) | (b - a) / max(a, b) | avg max (σi+σj)/dij |
| Better When | Higher | Higher | Lower |
| Range | [0, ∞) | [-1, 1] | [0, ∞) |
| Complexity | O(n·k) | O(n²) | O(n·k) |
| Convexity Bias | Assumes convex | Euclidean convexity bias | Assumes convex |
| Best For | Fast k-selection with k-means | Diagnosing individual point assignments | Worst-case cluster overlap detection |
Calinski-Harabasz
Silhouette Score
Davies-Bouldin
Use Silhouette when...
- - You need per-point diagnostics (which points are misassigned?)
- - You need per-point diagnostics under a justified distance metric
- - You need a bounded, interpretable score (-1 to +1)
Consider alternatives when...
- - Dataset is large (O(n²) becomes prohibitive) — use CH instead
- - You only need to compare k values, not diagnose points — use CH
- - You want cluster-level worst-case analysis — use Davies-Bouldin
Related concepts
How the Calinski-Harabasz index evaluates clustering quality by measuring the ratio of between-cluster to within-cluster variance — fast, intuitive, and ideal for k-selection with convex clusters.
How the Davies-Bouldin index evaluates clustering quality by finding each cluster's most similar neighbor — a pessimistic, worst-case metric that catches overlapping cluster pairs.
Learn how IVF-PQ combines clustering and compression to enable billion-scale vector search with minimal memory footprint.
Explore an illustrative region-tiling policy: resize tiles, calculate visual tokens, and distinguish analytical savings from measured model quality.
Learn batch normalization in deep learning: how normalizing layer inputs accelerates training, improves gradient flow, and acts as regularization.
BatchNorm normalizes over the batch and spatial axes; LayerNorm normalizes over the channel and spatial axes for each sample. The choice changes whether your model trains stably with batch=1, depends on batch composition at inference, and behaves consistently across train and eval.
