Search⌘ K
AI Features

Clustering Metrics

Understand how to evaluate clustering algorithms using metrics such as silhouette score, Calinski-Harabasz index, and Davies-Bouldin index. Learn how these metrics assess cluster compactness, separation, and similarity to determine clustering quality without needing ground truth labels.

Clustering metrics are used to evaluate the performance of clustering algorithms and assess how well they group similar data points. Because clustering tasks have no ground truth that we can use as a baseline, the choice of metric can be much more subjective.

Classification metrics are designed to assess the correctness of class assignments, making them less relevant when measuring the performance of clustering. In clustering, the focus is on the intrinsic structure of the data and the degree to which similar data points are grouped together, which is fundamentally different from the explicit class prediction and evaluation in classification tasks. That’s why we need specific metrics for this.

Let’s look at some of the most common clustering metrics and what they try to measure.

Silhouette score

The silhouette score measures how well each sample in a cluster is separated from samples in other clusters. It quantifies the compactness (how close cluster members are to each other) and separation of clusters (how far members of different clusters are from each other), with values ranging from 1-1 to 11. A higher score indicates better-defined clusters.

The silhouette score is calculated as the difference between the average distance to samples in the same cluster (a ...