induwara.lk
induwara.lkAI · Clustering metrics

Davies–Bouldin Index Calculator

Paste your data points and cluster labels to get the Davies–Bouldin Index, each cluster's dispersion and centroid, and the full pairwise Rᵢⱼ matrix. Lower is better. Matches scikit-learn davies_bouldin_score. No signup, nothing uploaded.

By Induwara AshinsanaUpdated Jul 12, 2026
Davies–Bouldin Index calculator

One point per line. Coordinates separated by commas or spaces.

One label per point, same order. Numbers or names (e.g. 0, 0, 1).

Distance metric
Euclidean (L2) · scikit-learn default
Decimals
Examples
Davies–Bouldin Index
0.1350
Excellent separation

Lower is better · minimum 0

Clusters are tight and clearly apart. As a guide, DBI below 0.5 points to a strong, well-separated clustering — but always compare against your other runs on the same data.

Points
9
Clusters
3
Dimensions
2

Cross-check. The main routine reports 0.1350; an independent reference implementation that recomputes every centroid, dispersion, and centroid distance from scratch gives 0.1350. The two routes reconcile, as they must.

Per-cluster breakdown

ClusterSizeCentroidDispersion SᵢDᵢMost similar
03[1.5000, 1.4000]0.59290.13502
13[8.5000, 8.4000]0.59290.13502
23[0.9667, 8.9333]0.42630.13501
Davies–Bouldin Index = mean of Dᵢ0.1350

Pairwise similarity Rᵢⱼ

i \ j012
00.11980.1350
10.11980.1350
20.13500.1350

Highlighted cell in each row is that cluster's Dᵢ (its most similar rival).

Method: centroid cᵢ = cluster mean; dispersion Sᵢ = mean distance to cᵢ; Rᵢⱼ = (Sᵢ + Sⱼ) / Mᵢⱼ; Dᵢ = maxⱼ Rᵢⱼ; DB = mean Dᵢ. Lower is better. Matches scikit-learn davies_bouldin_score. Sources: scikit-learn docs, Davies & Bouldin (1979). Nothing leaves this page.

How it works

The Davies–Bouldin Index (DBI) measures how well a set of clusters is separated relative to how spread out each one is. Like the silhouette score it is an internal validity index — it needs no ground-truth labels, so it is a standard way to judge a k-means, hierarchical, or DBSCAN result and to compare different choices of k. It was defined by David Davies and Donald Bouldin in 1979 and is what scikit-learn returns from davies_bouldin_score.

For a clustering with k clusters (k ≥ 2), the tool computes:

  1. Centroid cᵢ. The coordinate-wise mean of the points in cluster i.
  2. Dispersion Sᵢ. The mean Euclidean distance from each point in cluster i to its centroid: Sᵢ = (1 / |Cᵢ|) · Σ ‖x − cᵢ‖. This is scikit-learn's p = q = 1 choice. Smaller means a tighter cluster.
  3. Separation Mᵢⱼ. The Euclidean distance between the centroids of clusters i and j: Mᵢⱼ = ‖cᵢ − cⱼ‖. Larger means the clusters sit further apart.
  4. Similarity ratio Rᵢⱼ. Rᵢⱼ = (Sᵢ + Sⱼ) / Mᵢⱼ. It is high when two clusters are both loose and close — that is, when they overlap.
  5. Worst rival Dᵢ. Dᵢ = max over j ≠ i of Rᵢⱼ. Each cluster is judged by its most similar competing cluster.

The index is the plain average of Dᵢ over all clusters: DB = (1 / k) · Σ Dᵢ. Distance is Euclidean throughout, matching scikit-learn's default. The minimum is 0 — reached only by perfectly tight, perfectly separated clusters — and there is no fixed upper bound, so lower is betterand DBI values are only comparable across clusterings of the same data. Two edge cases are guarded exactly as scikit-learn does: if every dispersion is zero or every centroid coincides, the index is reported as 0; and if two distinct clusters happen to share a centroid, that pair's ratio is treated as 0 rather than a division by zero. As a credibility check the tool also recomputes the index a second way — an independent reference pass that rebuilds every centroid, dispersion, and centroid distance from scratch — and confirms the two agree.

Worked examples

Well-separated clusters (2-D) — A = 4 points near (0,0), B = 4 points near (10,10)

  1. A = (0,0),(1,0),(0,1),(1,1) → centroid (0.5,0.5); each point √0.5 = 0.7071 away ⇒ S_A = 0.7071
  2. B = (10,10),(11,10),(10,11),(11,11) → centroid (10.5,10.5) ⇒ S_B = 0.7071
  3. M_AB = ‖(0.5,0.5) − (10.5,10.5)‖ = √(100+100) = 14.1421
  4. R_AB = (0.7071 + 0.7071) / 14.1421 = 0.1000 ⇒ D_A = D_B = 0.1000
  5. DBI = (0.1000 + 0.1000) / 2 = 0.1000 → excellent separation

Overlapping clusters (2-D) — A = 4 points near (1,1), B = 4 points near (4,4)

  1. A = (0,0),(2,0),(0,2),(2,2) → centroid (1,1); each point √2 = 1.4142 ⇒ S_A = 1.4142
  2. B = (3,3),(5,3),(3,5),(5,5) → centroid (4,4) ⇒ S_B = 1.4142
  3. M_AB = √(9+9) = 4.2426
  4. R_AB = (1.4142 + 1.4142) / 4.2426 = 0.6667 ⇒ DBI = 0.6667 → good, but looser than above

Three clusters (1-D) — shows the max-over-j step — A={0,2}, B={10,12}, C={20,22}

  1. Centroids: A → 1, B → 11, C → 21; each S = 1 (both points are 1 away)
  2. Centroid distances: M_AB = 10, M_AC = 20, M_BC = 10
  3. R_AB = 2/10 = 0.2, R_AC = 2/20 = 0.1, R_BC = 2/10 = 0.2
  4. D_A = max(0.2, 0.1) = 0.2; D_B = max(0.2, 0.2) = 0.2; D_C = max(0.1, 0.2) = 0.2
  5. DBI = (0.2 + 0.2 + 0.2) / 3 = 0.2 → excellent separation

Frequently asked questions

Sources & references

The formulas on this page were last cross-checked against these sources on 2026-07-12. The Davies–Bouldin Index is a stable mathematical definition, so this tool needs no rate or schedule updates — only the worked examples are periodically re-reconciled against scikit-learn.

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.