We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db0d54d commit 00701b9Copy full SHA for 00701b9
hdbscan/tests/test_hdbscan.py
@@ -131,12 +131,18 @@ def homogeneity(labels1, labels2):
131
num_missed = 0.0
132
for label in set(labels1):
133
matches = labels2[labels1 == label]
134
- match_mode, mode_count = mode(matches)
+ try:
135
+ match_mode, mode_count = mode(matches, keepdims=True)
136
+ except:
137
+ match_mode, mode_count = mode(matches)
138
num_missed += np.sum(matches != match_mode[0])
139
140
for label in set(labels2):
141
matches = labels1[labels2 == label]
142
143
144
145
146
147
148
return num_missed / 2.0
0 commit comments