Skip to content

Commit efe01e7

Browse files
committed
Bug fix for issue #10.
1 parent 44ca750 commit efe01e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hdbscan/_hdbscan_tree.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ cpdef np.ndarray condense_tree(np.ndarray[np.double_t, ndim=2] hierarchy,
7878
right_count = <long long> (hierarchy[right - num_points][3]
7979
if right >= num_points else 1)
8080

81-
if left_count > min_cluster_size and right_count > min_cluster_size:
81+
if left_count >= min_cluster_size and right_count >= min_cluster_size:
8282
relabel[left] = next_label
8383
next_label += 1
8484
result_list.append((relabel[node], relabel[left], lambda_value, left_count))
@@ -87,7 +87,7 @@ cpdef np.ndarray condense_tree(np.ndarray[np.double_t, ndim=2] hierarchy,
8787
next_label += 1
8888
result_list.append((relabel[node], relabel[right], lambda_value, right_count))
8989

90-
elif left_count <= min_cluster_size and right_count <= min_cluster_size:
90+
elif left_count < min_cluster_size and right_count < min_cluster_size:
9191
for sub_node in bfs_from_hierarchy(hierarchy, left):
9292
if sub_node < num_points:
9393
result_list.append((relabel[node], sub_node, lambda_value, 1))
@@ -98,7 +98,7 @@ cpdef np.ndarray condense_tree(np.ndarray[np.double_t, ndim=2] hierarchy,
9898
result_list.append((relabel[node], sub_node, lambda_value, 1))
9999
ignore[sub_node] = True
100100

101-
elif left_count <= min_cluster_size:
101+
elif left_count < min_cluster_size:
102102
relabel[right] = relabel[node]
103103
for sub_node in bfs_from_hierarchy(hierarchy, left):
104104
if sub_node < num_points:

0 commit comments

Comments
 (0)