Skip to content

Commit db0d54d

Browse files
committed
Homogeneity computation
1 parent 407c5ac commit db0d54d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hdbscan/tests/test_hdbscan.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ def homogeneity(labels1, labels2):
131131
num_missed = 0.0
132132
for label in set(labels1):
133133
matches = labels2[labels1 == label]
134-
match_mode = mode(matches)[0][0]
135-
num_missed += np.sum(matches != match_mode)
134+
match_mode, mode_count = mode(matches)
135+
num_missed += np.sum(matches != match_mode[0])
136136

137137
for label in set(labels2):
138138
matches = labels1[labels2 == label]
139-
match_mode = mode(matches)[0][0]
140-
num_missed += np.sum(matches != match_mode)
139+
match_mode, mode_count = mode(matches)
140+
num_missed += np.sum(matches != match_mode[0])
141141

142142
return num_missed / 2.0
143143

0 commit comments

Comments
 (0)