Silhouette scores each point. Sometimes you want a single number for the whole clustering that asks whether clusters are compact and far apart. The Davies-Bouldin index does that: for each cluster, find the most similar other cluster (similar means spread-to-separation ratio is high), then average those worst-case ratios. Lower is better, and 0 is the floor.
Implement davies_bouldin_index(X, labels).
ValueError.Open one at a time. Each gives away a little more than the last.
Use np.unique(labels) to loop over clusters, and compute each centroid with a boolean mask.
Build the full k-by-k matrix of centroid distances, then mask out the diagonal before taking the max.
No results yet
Run your code to check it against the examples, or submit to run every test.