Calculate the Dunn Index for clustering from the minimum distance between clusters and the largest cluster diameter, from summary lists, or from raw data.
Related Calculators
- Jaccard Coefficient Calculator
- Affinity Index Calculator
- SS Between Calculator
- Modified Z Score Calculator
- All Statistics Calculators
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| Dunn Index from global extrema | Finds the Dunn index of a clustering from its two extreme distances | Requires the global minimum intercluster distance and the global maximum intracluster diameter |
| Minimum separation from index | Finds the minimum intercluster distance that gives a chosen Dunn index | Requires the Dunn index and the global maximum intracluster diameter |
| Maximum diameter from index | Finds the maximum intracluster diameter that gives a chosen Dunn index | Requires the global minimum intercluster distance and a Dunn index above zero |
| From distance summary lists | Picks the smallest separation and the largest diameter from two lists, then finds the Dunn index | Requires a list of every cluster-pair separation and a list of every cluster diameter |
| From labeled data rows | Computes every distance from raw points and finds the Dunn index or a generalized variant | Requires one row per point with its coordinates and cluster label, plus a distance and the two cluster definitions |
All distances must be in the same units and come from the same distance measure. Every result also shows the minimum separation and the maximum spread that were used.
Dunn Index Formulas
| DI | Dunn index, from zero upward. Higher is better |
| dmin | Smallest distance between two observations that are not in the same cluster |
| Dmax | Largest cluster diameter, where a diameter is the greatest distance between two observations in one cluster |
Dunn Index from global extrema
Both inputs are taken across the whole clustering: one closest pair of points in different clusters, and one widest cluster [1]. A minimum separation of 5 and a maximum diameter of 2 give DI = 5 รท 2 = 2.5. A separation of zero gives an index of 0, and the diameter must be above zero.
Minimum separation from index
An index of 2.5 with a maximum diameter of 2 needs clusters at least 5 apart.
Maximum diameter from index
The index and the separation must both be above zero, because a zero index does not point to one diameter.
From distance summary lists
The calculator takes the minimum of the separation list and the maximum of the diameter list, then divides. Separations of 4, 6 and 5 with diameters of 2, 3 and 1.5 give 4 รท 3 = 1.333. The lists must cover every pair of clusters and every cluster, or the extremes can be missed. Values can be separated by commas, spaces or new lines, up to 10,000 entries in each list.
From labeled data rows
Each row holds the coordinates of one point followed by its cluster label, such as 0,1,A. The calculator accepts up to 500 rows of up to 20 coordinates and needs at least two labels. Distance can be Euclidean, Manhattan or cosine, where cosine distance is 1 minus the cosine of the angle between two vectors and cannot be used with a zero vector.
The standard Dunn index uses the minimum point-to-point distance between clusters and the maximum pairwise distance within a cluster [1]. The calculator also offers centroid-to-centroid separation, average pairwise spread and twice the mean distance to the centroid. With any of those selected, the result is labeled a generalized Dunn variant, and its value should not be compared with a standard Dunn index.
For cluster A at (0,0), (0,1) and (1,0) and cluster B at (5,5), (5,6) and (6,5), the closest pair across clusters is 6.403 apart in Euclidean distance and the widest cluster is 1.414 across, so DI = 4.528.
Limits of This Estimate
- Each half of the ratio rests on a single pair of points, so one outlier can change the index sharply.
- The index has no fixed cutoffs for weak or strong clustering. It ranks clusterings of the same data, with the same scaling and the same distance measure.
- Features on different scales should be standardized first, or the largest-scale feature will dominate every distance.
- If every cluster has zero spread, the ratio is undefined and the calculator reports that instead of substituting a small number.
Sources
- Brock, Pihur, Datta and Datta, clValid: An R Package for Cluster Validation, Section 2.1: definition of the Dunn index, cluster diameter, its range and that it should be maximized
