Two Centroid-Based Views of Cluster Separation
The Calinski-Harabasz (CH) and Davies-Bouldin (DB) indices summarize different aspects of a partition in a feature space. CH compares between-cluster dispersion with within-cluster dispersion. DB asks whether each cluster is compact relative to its most similar neighboring cluster. Both are internal validity measures: they assess a partition using the data representation and cluster assignments, not external reference labels.
For single-cell data, the numerical values depend on the representation being evaluated: for example, a selected set of transformed expression features or a low-dimensional embedding. The indices do not establish that clusters correspond to distinct cell types. They describe geometric separation under the chosen representation and distance.
The indices use different summaries of spread. CH uses squared Euclidean distances in its sums of squares, whereas DB uses mean Euclidean distances from centroids. A CH value is not directly comparable with a DB value, and neither has a universal cutoff for “good” clustering.
Why the Calinski-Harabasz Ratio Has This Form
The CH index is a ratio of two mean-square quantities. The denominator \(W/(n-k)\) describes within-cluster squared dispersion per residual degree of freedom; the numerator \(B/(k-1)\) describes between-cluster squared dispersion per cluster degree of freedom. The degrees of freedom motivate the ratio, but do not make it an ordinary inferential F-test. In particular, cluster assignments are typically estimated from the same data being scored.
The decomposition \(T=W+B\), where \(T=\sum_i\|x_i-\mu\|^2\) is total squared dispersion, follows from centering each observation at its cluster centroid and then at the global centroid. For \(x_i\in C_j\), write \(x_i-\mu=(x_i-\mu_j)+(\mu_j-\mu)\). Summing squared norms gives a cross-product term proportional to \(\sum_{x_i\in C_j}(x_i-\mu_j)\), which is zero because \(\mu_j\) is the cluster mean. Thus the within- and between-cluster sums account for total dispersion exactly.
A partition with small \(W\) and large \(B\) therefore tends to have a large CH value. However, \(B\) and \(W\) can change as the number of clusters changes. The degrees-of-freedom adjustment does not guarantee that the largest CH value identifies a biologically meaningful number of cell populations.
Worked Example: Calculating Both Indices for Two Clusters
Consider four hypothetical cells represented by one numeric feature, with values \(0,2,8,10\). Assign \(C_1=\{0,2\}\) and \(C_2=\{8,10\}\). The cluster centroids are \(\mu_1=1\) and \(\mu_2=9\); the global mean is \(\mu=5\). Each cluster has two cells, so \(n=4\) and \(k=2\).
For CH, the within-cluster sum of squares is
The between-cluster sum of squares is
Substitution gives
For DB, each cluster’s mean distance to its centroid is \(1\), and the centroid distance is \(M_{12}=|9-1|=8\). There is only one competing cluster for each cluster, so
These values describe this particular partition in this one-feature representation. CH \(=32\) is not a probability or a test statistic with a p-value; DB \(=0.25\) is not an error rate.
Unequal Cluster Sizes and the Nearest-Competitor Rule
The two indices weight clusters differently. In CH, every observation contributes to \(W\) and \(B\), so a large cluster has more influence on those sums than a small cluster. In DB, the final average gives each cluster’s \(D_j\) equal weight, regardless of its size. But \(D_j\) is determined by the largest scatter-to-separation ratio against any one competing cluster. A problematic close pair can therefore dominate the DB score even if other clusters are well separated.
Worked Example: An Unequal-Size Partition
Take the hypothetical one-dimensional clusters \(C_1=\{0,1,2,3\}\) and \(C_2=\{7,8\}\). Their centroids are \(1.5\) and \(7.5\), the global mean is \(3.5\), and \(n=6,\ k=2\).
For CH, the within-cluster sum of squares is \(W=5+0.5=5.5\): the first cluster contributes \(2.25+0.25+0.25+2.25=5\), and the second contributes \(0.25+0.25=0.5\). The between-cluster sum is
Therefore,
For DB, the mean distances to the centroids are \(S_1=(1.5+0.5+0.5+1.5)/4=1\) and \(S_2=(0.5+0.5)/2=0.5\). The centroid distance is \(6\), so
The relatively large first cluster contributes more observations to CH’s sums, while DB averages the two cluster-level ratios equally. Neither weighting scheme is automatically preferable; the relevant question is whether it matches the structure one wants to assess.
When the Indices Disagree
Because CH and DB summarize different quantities, they need not rank candidate partitions in the same order. DB can be especially vulnerable to singleton clusters: a singleton has zero distance from its own centroid, so it contributes zero scatter. This can make a partition’s DB value look favorable even when the extra cluster is not substantively useful.
Worked Example: A Singleton Can Lower DB
Use the same hypothetical values \(0,2,8,10\), but now consider three clusters: \(C_1=\{0,2\}\), \(C_2=\{8\}\), and \(C_3=\{10\}\). Their centroids are \(1,8,10\), and the global mean remains \(5\). Here \(n=4,\ k=3\).
The within-cluster sum of squares is \(W=2+0+0=2\). The between-cluster sum is
Thus
For DB, the scatters are \(S_1=1,\ S_2=0,\ S_3=0\). The three pairwise centroid distances are \(7,9,\) and \(2\). Hence \(D_1=1/7\), \(D_2=1/7\), and \(D_3=1/9\), giving
Relative to the two-cluster partition, CH falls from \(32\) to \(16.5\), while DB falls from \(0.25\) to about \(0.1323\). DB alone would favor the three-cluster partition, partly because the two singleton clusters have zero within-cluster scatter. This example shows why scores should be examined alongside cluster sizes and the actual partition, rather than optimized mechanically.
Assumptions, Diagnostics, and Limitations
These indices require a chosen representation, a distance, and a partition. The standard formulas above use Euclidean distances and arithmetic centroids. Their geometric summaries are most informative when centroids are meaningful and clusters are reasonably compact around them. They can be misleading for elongated, curved, nested, or otherwise non-convex groups: a centroid may lie in a low-density region or fail to represent the cluster’s structure. Two clusters may have similar centroid distances and scatter summaries while differing substantially in their shapes or connectivity.
For single-cell analysis, the following checks help interpret the scores:
- Check the representation and scaling. A feature with a large numeric scale can dominate Euclidean distances. Recompute only after choosing a representation appropriate to the analysis question; changing feature scaling or embedding can change both indices.
- Inspect cluster sizes and singleton counts. Very small clusters can distort interpretation, especially for DB, where singleton scatter is zero. A small cluster is not automatically invalid, but its score contribution deserves inspection.
- Check centroids and distances. Identical centroids make DB undefined for that pair. Very small centroid distances can make a ratio large and unstable. Centroid distances also do not reveal every kind of overlap or non-convex structure.
- Compare like with like. Scores are most interpretable when candidate partitions use the same cells, feature representation, distance, and preprocessing. Even then, changing \(k\) changes the index formulas and may change the balance of compactness and separation.
- Look beyond one summary. The earlier material on silhouette widths assesses cell-level relative separation differently. It can provide a complementary view, but it too depends on the selected distance and representation.
Neither index accounts for biological interpretation, uncertainty in cell assignments, or whether an apparent group is reproducible under changes to the data or analysis. A high CH or low DB score is evidence only that a partition has favorable geometry according to that index. These are descriptive diagnostics, not p-values, confidence intervals, or proof that clusters are biologically distinct.
Common Mistakes
- Choosing a partition solely because its score is extreme. More clusters can reduce within-cluster dispersion, while DB can reward singleton clusters. Inspect sizes, assignments, and the representation as well.
- Interpreting DB as a probability or percentage. It is an average of ratios of distances, not an error probability. Lower values indicate more favorable compactness relative to centroid separation under the definition used.
- Treating CH as an inferential F-test. Its ratio resembles a mean-square ratio, but ordinary F-test conclusions do not follow from calculating it on data-dependent clusters.
- Assuming centroid summaries capture every cluster shape. They can miss curved or elongated structure. A favorable index does not establish that the clusters are separated in every meaningful sense.
Check Your Understanding
Try each question before reading the solutions below.
- For \(n=10\), \(k=2\), \(B=90\), and \(W=20\), calculate CH.
- Two clusters have scatters \(0.6\) and \(0.4\), and their centroid distance is \(5\). If these are the only two clusters, calculate DB.
- Why can adding singleton clusters make DB appear better even if the partition is not more useful?
- Does a high CH value show that a cluster partition is biologically correct? Explain.
Solutions. (1) \(CH=[90/(2-1)]/[20/(10-2)]=90/2.5=36\). (2) Each cluster has \(D=(0.6+0.4)/5=0.2\), so \(DB=(0.2+0.2)/2=0.2\). (3) A singleton has zero mean distance from its centroid, reducing its scatter contribution; DB may therefore decrease even though the added group is not substantively meaningful. (4) No. CH summarizes between- and within-cluster squared dispersion in the selected representation. It does not establish biological identity, reproducibility, or correctness.