Skip to content

Commit 68b68aa

Browse files
update
1 parent 6d06616 commit 68b68aa

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/mintflow/evaluation/mcc_entropy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ def _gpu_kl_entropy(np_data, k_calcentropy):
3434

3535
# 1. Use cuML to find the distance to the k-th neighbor
3636
# We set n_neighbors=k+1 because the first neighbor is the point itself (dist=0)
37-
nn = NearestNeighbors(n_neighbors=k+1)
37+
nn = NearestNeighbors(
38+
n_neighbors=min(
39+
k+1,
40+
N
41+
)
42+
)
3843
nn.fit(data)
3944
distances, _ = nn.kneighbors(data)
4045

0 commit comments

Comments
 (0)