The silhouette score is an internal clustering validation metric that measures how well each data point fits its assigned cluster compared with the nearest neighboring cluster, producing a value between -1 and 1. In model evaluation for artificial intelligence and machine learning, it is one of the most widely used ways to judge an unsupervised clustering result when no ground-truth labels exist.
The metric, also called the silhouette coefficient, was proposed by Peter Rousseeuw in 1987 together with a graphical display known as the silhouette plot. It rewards clusters that are compact internally and well separated from each other, and it is commonly used to compare algorithms, distance measures and candidate numbers of clusters.
How the silhouette score is calculated
The silhouette score is computed per point from two average distances and then averaged over the whole dataset. For a point i, the value a(i) is the mean distance to all other members of its own cluster, which measures cohesion. The value b(i) is the smallest mean distance from i to the members of any other cluster, which measures separation from the nearest alternative.
The point silhouette is s(i) = (b(i) - a(i)) / max(a(i), b(i)). By convention, a point that is alone in its cluster receives a silhouette of zero. The overall silhouette score is the mean of s(i) across all points, although per-cluster means are often reported as well because a single average can hide one poor cluster.
The following table shows how individual silhouette values are usually interpreted.
| Silhouette value | Meaning for the point | Typical action |
|---|---|---|
| Close to 1 | Deep inside its own cluster | None needed |
| Around 0 | On the boundary between two clusters | Check whether clusters should merge |
| Negative | Closer to another cluster than its own | Likely misassigned, inspect the point |
| Close to -1 | Clearly in the wrong cluster | Revisit the algorithm or the number of clusters |
The calculation needs only a distance function and the cluster labels. Euclidean distance is the default, but cosine distance is common for text and embedding vectors, and any metric that suits the data can be used, which makes the score applicable well beyond k-means.
Reading the overall score
An overall silhouette score is read on rough bands rather than strict thresholds, because its typical level depends on the data and dimensionality. Rousseeuw’s original guidance remains a practical starting point and is summarized below.
| Average silhouette | Usual interpretation | Caution |
|---|---|---|
| 0.71 to 1.00 | Strong cluster structure | Verify that clusters are not trivial outlier groups |
| 0.51 to 0.70 | Reasonable structure | Usually acceptable for segmentation |
| 0.26 to 0.50 | Weak structure, possibly artificial | Inspect with plots and domain knowledge |
| 0.25 or lower | No substantial structure found | Clusters may reflect noise or arbitrary cuts |
These bands are heuristics, not statistical tests. In high-dimensional embedding spaces, distances tend to concentrate, and scores of 0.1 to 0.3 are common even for useful groupings. A score is most informative when used comparatively, for example across different values of k on the same data and with the same distance metric.
Choosing the number of clusters with silhouette analysis
Silhouette analysis selects the number of clusters by fitting the model for a range of k values and choosing the k with the highest average silhouette, subject to a visual check. It is often preferred over the elbow method because it gives a clearer maximum instead of a subjective bend in a curve.
The silhouette plot sorts point values within each cluster and draws them as horizontal bars. Good solutions show clusters of similar thickness whose bars mostly exceed the average line. Thin clusters, many negative bars or one cluster far below average indicate that the chosen k splits or merges natural groups.
- Standardize or otherwise scale features so that no single feature dominates the distance.
- Fit the clustering model for k from 2 up to a sensible maximum, such as 10 or 15.
- Compute the average silhouette and the per-cluster silhouettes for each k.
- Shortlist the best values and inspect their silhouette plots before choosing.
How it compares with other clustering metrics
The silhouette score belongs to the family of internal validation indices, which judge clusters from the data alone, unlike external indices that require true labels. The table places it among the metrics a practitioner is most likely to report.
| Metric | Needs labels | Better value | Main strength or weakness |
|---|---|---|---|
| Silhouette score | No | Higher, up to 1 | Intuitive per-point view, quadratic cost |
| Davies-Bouldin index | No | Lower, minimum 0 | Fast, but assumes centroid-based clusters |
| Calinski-Harabasz index | No | Higher, unbounded | Fast, favors convex clusters |
| Adjusted Rand index | Yes | Higher, up to 1 | Compares with ground truth, corrects for chance |
| Normalized mutual information | Yes | Higher, up to 1 | Label agreement, less sensitive to cluster count |
Unlike supervised metrics such as accuracy or the F1 score, none of the internal indices confirm that clusters are meaningful for the business or scientific question. They measure geometric quality only, so reporting two complementary indices plus a qualitative review is a common and sound practice.
Limitations and common mistakes
The silhouette score has a clear bias toward convex, similarly sized clusters, and it can mislead on other shapes. Density-based methods such as DBSCAN may find correct ring-shaped or elongated clusters that nonetheless receive a low silhouette, because the metric compares mean distances rather than connectivity.
| Pitfall | Consequence | Better practice |
|---|---|---|
| Unscaled features | One feature dominates distances | Standardize before clustering and scoring |
| Including noise points | Score distorted for DBSCAN results | Exclude noise labels or report separately |
| Full computation on huge data | O(n²) time and memory | Score a random sample of points |
| Comparing different distance metrics | Values are not comparable | Fix one metric for every candidate |
| Trusting the average alone | One bad cluster stays hidden | Inspect per-cluster values and plots |
Because the full calculation compares every pair of points, datasets above roughly 100,000 samples are usually scored on a representative sample of 10,000 to 50,000 points. Repeating the sample a few times shows whether the estimate is stable enough to support a decision.
The simple explanation
The silhouette score asks every data point a simple question: are you closer to your own group or to the nearest other group? If a point sits comfortably among its own group, it scores near 1. If it sits on the fence, it scores near 0. If it would fit better elsewhere, it scores below 0.
Averaging these answers gives one number for the whole grouping. A high average means the groups are tight and clearly apart, like guests at a party standing in distinct circles. A low average means the circles blur into one crowd, and the grouping may not reflect anything real.
How it is used in practice
A data scientist at a subscription streaming service wants to group about 400,000 customers by viewing behavior to tailor email campaigns. She builds 12 standardized features, such as weekly hours, share of series versus films and late-night viewing, and runs k-means for k from 2 to 10. Silhouette scores are computed on a random sample of 30,000 customers, repeated three times.
The average silhouette peaks at 0.42 for k equal to 5, while k equal to 3 scores 0.39 and k equal to 8 drops to 0.27. The silhouette plot for k equal to 5 shows one thin cluster with many negative values, which turns out to mix weekend binge viewers and occasional users. After removing two noisy features, the score rises to 0.48, and the marketing team receives five clearly distinct segments that it can describe and target.