Davies-Bouldin Index

medium
Unit 9 · Clustering & Classification0/2 to milestone

The Davies-Bouldin index rates a clustering by how compact clusters are relative to how far apart they are. Lower is better.

For each cluster ii: sis_i is the mean distance of its points to its centroid. For each pair, Rij=si+sj∥ci−cj∥R_{ij} = \frac{s_i + s_j}{\|c_i - c_j\|}. The index is the mean over clusters of max⁡j≠iRij\max_{j \ne i} R_{ij}.

Implement davies_bouldin(X, labels) (Euclidean distances, at least 2 clusters).

#clustering#metrics2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Davies-Bouldin Index · TechGradify