Skip to main content

Silhouette Score: Per-Point Clustering Evaluation

How the silhouette score measures clustering quality for every individual point — comparing intra-cluster cohesion to nearest-cluster separation, with per-point diagnostics and explicit distance-metric assumptions.

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:

a(i) = \frac{1}{|C_k| - 1} \sum_{x_j \in C_k, j \neq i} d(x_i, x_j)

This is the average distance to all other points in the same cluster — the intra-cluster distance.

b(i) = \min_{C_l \neq C_k} \frac{1}{|C_l|} \sum_{x_j \in C_l} d(x_i, x_j)

This is the average distance to points in the nearest other cluster — the nearest-cluster distance.

The silhouette score for point x_i is:

s(i) = \frac{b(i) - a(i)}{\max(a(i), b(i))}

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.

Interactive visualization
0.83
Avg Silhouette
0.65
Min Score
0%
% Negative
All points score above 0.7 — every point is dramatically closer to its own cluster than to any other. The strong teal coloring across all clusters indicates unambiguous cluster assignments.

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).

Scatter plot of 45 points in three clusters
Step 1 / 4

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.

Number of clusters
Point 0: (-2.7500, -1.0000), cluster 1Point 1: (2.2272, -0.7501), cluster 2Point 2: (0.0428, 2.5119), cluster 3Point 3: (-2.6289, -0.5159), cluster 1Point 4: (1.7812, -1.1272), cluster 2Point 5: (0.7172, 2.5438), cluster 3Point 6: (-3.2518, -0.0633), cluster 1Point 7: (2.3848, -1.2219), cluster 2Point 8: (0.3475, 3.1269), cluster 3Point 9: (-3.4529, -0.8130), cluster 1Point 10: (2.7585, -1.5525), cluster 2Point 11: (0.2185, 3.6965), cluster 3Point 12: (-3.7354, -1.4262), cluster 1Point 13: (3.4474, -1.2083), cluster 2Point 14: (-0.1438, 3.2045), cluster 3Point 15: (-3.0475, -1.3669), cluster 1Point 16: (2.8747, -0.6842), cluster 2Point 17: (-0.6095, 3.0252), cluster 3Point 18: (-2.4826, -1.5149), cluster 1Point 19: (2.4607, -0.1509), cluster 2Point 20: (-0.6215, 2.2552), cluster 3Point 21: (-2.7522, -0.9667), cluster 1Point 22: (2.1963, -0.7887), cluster 2Point 23: (0.1075, 2.5219), cluster 3Point 24: (-2.6967, -0.4707), cluster 1Point 25: (1.8045, -1.2219), cluster 2Point 26: (0.7716, 2.6435), cluster 3Point 27: (-3.3745, -0.1052), cluster 1Point 28: (2.4154, -1.2352), cluster 2Point 29: (0.3275, 3.1721), cluster 3Point 30: (-3.4738, -0.8751), cluster 1Point 31: (2.8299, -1.5131), cluster 2Point 32: (0.1236, 3.7195), cluster 3Point 33: (-3.6720, -1.5205), cluster 1Point 34: (3.4667, -1.0801), cluster 2Point 35: (-0.1698, 3.1835), cluster 3Point 36: (-2.9982, -1.3700), cluster 1Point 37: (2.8292, -0.6371), cluster 2Point 38: (-0.6074, 2.9437), cluster 3Point 39: (-2.4185, -1.4413), cluster 1Centroid 1Centroid 2Centroid 3

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
k=2
0.551
k=3
0.821
k=4
0.668
k=5
0.500
k=6
0.543

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

p15
0.864
p36
0.863
p0
0.860
p21
0.859
p30
0.854
p9
0.852
p33
0.825
p12
0.825
p18
0.810
p39
0.807
p24
0.806
p3
0.805
p27
0.764
p6
0.757

Cluster 2: 13 points

p28
0.864
p7
0.863
p31
0.846
p10
0.844
p16
0.837
p37
0.833
p22
0.833
p1
0.833
p13
0.805
p34
0.801
p25
0.790
p4
0.785
p19
0.730

Cluster 3: 13 points

p14
0.869
p35
0.869
p29
0.857
p8
0.855
p2
0.827
p23
0.827
p32
0.825
p11
0.824
p17
0.816
p38
0.814
p26
0.761
p5
0.758
p20
0.717
Inspect all point coordinates, assignments and distances
PointxyClusterabs
0-2.7500-1.000010.68174.86710.8599
12.2272-0.750120.72604.33560.8325
20.04282.511930.75334.36400.8274
3-2.6289-0.515910.86024.40690.8048
41.7812-1.127220.96134.47120.7850
50.71722.543830.97874.04020.7578
6-3.2518-0.063311.08994.49240.7574
72.3848-1.221920.65964.82080.8632
80.34753.126930.68284.72450.8555
9-3.4529-0.813010.76415.16250.8520
102.7585-1.552520.82365.29250.8444
110.21853.696530.92885.28740.8243
12-3.7354-1.426211.01695.80640.8249
133.4474-1.208321.05685.40710.8046
14-0.14383.204530.65765.03900.8695
15-3.0475-1.366910.72635.33670.8639
162.8747-0.684220.75794.64340.8368
17-0.60953.025230.86294.69790.8163
18-2.4826-1.514910.97065.09670.8096
192.4607-0.150921.07363.97200.7297
20-0.62152.255231.14934.05910.7169
21-2.7522-0.966710.68154.84120.8592
222.1963-0.788720.72504.35330.8335
230.10752.521930.74944.33510.8271
24-2.6967-0.470710.85454.41300.8064
251.8045-1.221920.96054.56700.7897
260.77162.643530.97984.10430.7613
27-3.3745-0.105211.08794.61080.7640
282.4154-1.235220.65814.84740.8642
290.32753.172130.68374.77360.8568
30-3.4738-0.875110.76465.22210.8536
312.8299-1.513120.81725.29620.8457
320.12363.719530.93385.35040.8255
33-3.6720-1.520511.02195.83760.8249
343.4667-1.080121.05865.32120.8011
35-0.16983.183530.65885.03550.8692
36-2.9982-1.370010.72715.31090.8631
372.8292-0.637120.76254.57870.8335
38-0.60742.943730.86044.63020.8142
39-2.4185-1.441310.97235.02630.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

Calinski-Harabasz

FormulaSS_B / SS_W (normalized)
Better WhenHigher
Range[0, ∞)
ComplexityO(n·k)
Convexity BiasAssumes convex
Best ForFast k-selection with k-means

Silhouette Score

Formula(b - a) / max(a, b)
Better WhenHigher
Range[-1, 1]
ComplexityO(n²)
Convexity BiasEuclidean convexity bias
Best ForDiagnosing individual point assignments

Davies-Bouldin

Formulaavg max (σi+σj)/dij
Better WhenLower
Range[0, ∞)
ComplexityO(n·k)
Convexity BiasAssumes convex
Best ForWorst-case cluster overlap detection

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

If you found this explanation helpful, consider sharing it with others.

Mastodon