Skip to content

Commit 2d62536

Browse files
committed
Shouldn't have size zero clusters -- missed a case
1 parent 450d484 commit 2d62536

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hdbscan/validity.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,10 @@ def validity_index(X, labels, metric='euclidean',
348348

349349
internal_nodes_i = mst_nodes[i]
350350
for j in range(i + 1, max_cluster_id):
351+
352+
if np.sum(labels == j) == 0:
353+
continue
354+
351355
internal_nodes_j = mst_nodes[j]
352356
density_sep[i, j] = density_separation(
353357
X, labels, i, j,

0 commit comments

Comments
 (0)