Inferensys

Glossary

Silhouette Score

An internal cluster validation metric measuring how similar a data point is to its own cluster compared to other clusters, with values ranging from -1 to 1.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
CLUSTER VALIDATION METRIC

What is Silhouette Score?

The Silhouette Score is an internal cluster validation metric that quantifies how well each data point fits within its assigned cluster, providing a measure of cluster cohesion and separation for evaluating patient stratification quality.

The Silhouette Score measures how similar a patient is to its own cluster compared to other clusters, producing a value between -1 and 1. A score near 1 indicates a patient is well-matched to its own cluster and poorly matched to neighboring clusters, signifying optimal stratification. Scores near 0 suggest overlapping clusters, while negative values indicate a patient may have been assigned to the wrong group. The metric is calculated as (b - a) / max(a, b), where a is the mean intra-cluster distance and b is the mean nearest-cluster distance.

In patient stratification, the Silhouette Score serves as a critical diagnostic tool for selecting the optimal number of clusters (k) and comparing different algorithmic approaches such as K-Means, hierarchical clustering, or Gaussian Mixture Models. By averaging individual silhouette coefficients across all patients, data scientists obtain a global assessment of clustering validity. However, the score assumes spherical cluster shapes and may undervalue density-based groupings identified by algorithms like DBSCAN, necessitating complementary validation with cluster stability analysis and domain expertise.

Internal Cluster Validation

Key Characteristics of the Silhouette Score

The Silhouette Score provides a quantitative measure of cluster cohesion and separation, essential for validating patient stratification quality in unsupervised learning pipelines.

01

Definition and Range

The Silhouette Score measures how similar a patient is to its own cluster compared to other clusters. It ranges from -1 to 1, where:

  • +1: The patient is well-matched to its own cluster and poorly matched to neighboring clusters
  • 0: The patient is on or very close to the decision boundary between two clusters
  • -1: The patient is likely assigned to the wrong cluster

The score for a single data point i is calculated as: s(i) = (b(i) - a(i)) / max{a(i), b(i)} where a(i) is the mean intra-cluster distance and b(i) is the mean nearest-cluster distance.

02

Interpreting Cluster Quality

The average Silhouette Score across all patients provides a global assessment of clustering validity:

  • 0.71–1.00: A strong structure has been found; clusters are well-separated and cohesive
  • 0.51–0.70: A reasonable structure has been found; clusters are moderately distinct
  • 0.26–0.50: The structure is weak and could be artificial; consider alternative algorithms
  • < 0.25: No substantial structure has been found; the data likely lacks natural groupings

In clinical contexts, a score below 0.50 typically warrants revisiting feature selection or the number of clusters k.

03

Silhouette Plot Visualization

A Silhouette Plot displays each patient's individual score as a horizontal bar, grouped by cluster assignment. Key visual diagnostics include:

  • Cluster thickness: Proportional to cluster size; uniform thickness across clusters is desirable
  • Individual bar length: Longer bars indicate better fit; negative bars signal misclassification
  • Average score line: A vertical dashed line showing the overall mean, enabling quick quality assessment

This visualization is standard practice in clinical data science for presenting stratification results to non-technical stakeholders, as it intuitively reveals cluster overlap.

04

Determining Optimal k

The Silhouette Score is a primary heuristic for selecting the optimal number of clusters k in algorithms like K-Means and Hierarchical Clustering. The process involves:

  • Computing the average Silhouette Score for a range of k values (e.g., 2 to 10)
  • Selecting the k that maximizes the average score
  • Avoiding k values that produce clusters with below-average individual scores

This method is preferred over the Elbow Method when cluster shapes are non-spherical, as it accounts for both cohesion and separation rather than just within-cluster variance.

05

Limitations in Clinical Data

Despite its utility, the Silhouette Score has notable limitations in patient stratification:

  • Assumes convex clusters: Performs poorly with complex, non-convex disease trajectories identified by DBSCAN or HDBSCAN
  • Distance metric sensitivity: Euclidean distance may not capture clinical similarity; Manhattan or cosine distances often yield different scores
  • High-dimensional degradation: In genomic datasets with thousands of features, distance measures become less meaningful due to the curse of dimensionality
  • Ignores clinical utility: A mathematically optimal score does not guarantee clinically actionable subgroups

Always pair the Silhouette Score with clinical outcome validation and domain expert review.

06

Comparison with Other Metrics

The Silhouette Score is often used alongside complementary validation metrics:

  • Davies-Bouldin Index: Measures the average similarity between each cluster and its most similar one; lower values indicate better partitioning
  • Calinski-Harabasz Index: Ratio of between-cluster dispersion to within-cluster dispersion; higher values are better
  • Dunn Index: Ratio of minimum inter-cluster distance to maximum intra-cluster distance

Unlike these alternatives, the Silhouette Score provides per-sample diagnostics, making it uniquely valuable for identifying individual patients who are poorly classified and may represent transitional disease states.

CLUSTER VALIDATION

Frequently Asked Questions

Clear answers to common questions about interpreting and applying the Silhouette Score for robust patient subgroup discovery.

The Silhouette Score is an internal cluster validation metric that measures how similar a patient is to its own cluster compared to other clusters, producing a value ranging from -1 to 1. For each data point i, the calculation involves two distances: a(i), the mean intra-cluster distance (average dissimilarity to all other members of the same cluster), and b(i), the mean nearest-cluster distance (average dissimilarity to all members of the closest neighboring cluster). The silhouette coefficient for that point is s(i) = (b(i) - a(i)) / max{a(i), b(i)}. A score near +1 indicates the patient is well-matched to its own cluster and poorly matched to neighboring clusters, signifying a robust stratification. A score near 0 suggests the point lies on or very close to the decision boundary between two clusters, while negative values indicate the patient may have been assigned to the wrong cluster entirely. The overall cluster quality is assessed by averaging s(i) across all patients.

INTERNAL VALIDATION COMPARISON

Silhouette Score vs. Other Cluster Validation Metrics

A technical comparison of the Silhouette Score against other common internal cluster validation indices used for assessing patient stratification quality without ground truth labels.

MetricSilhouette ScoreDavies-Bouldin IndexCalinski-Harabasz IndexDunn Index

Core Measurement

Cohesion vs. Separation

Cluster Similarity Ratio

Between/Within Variance Ratio

Min Inter / Max Intra Distance

Optimal Value

Near +1

Near 0

Maximum

Maximum

Range

-1 to 1

0 to ∞

0 to ∞

0 to ∞

Sensitivity to Cluster Shape

Prefers convex clusters

Prefers convex clusters

Prefers convex clusters

Handles arbitrary shapes

Sensitivity to Noise

Moderate

Low

High

High

Computational Complexity

O(n²)

O(n log n)

O(n log n)

O(n²)

Handles Varying Density

Per-Sample Score Available

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.