Skip to content

Commit

Permalink
Back to fast_knn_indices as long as we have python>=3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcinnes committed Sep 8, 2019
1 parent 22855b6 commit 7900d14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions umap/umap_.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ def nearest_neighbors(
if metric == "precomputed":
# Note that this does not support sparse distance matrices yet ...
# Compute indices of n nearest neighbors
# knn_indices = fast_knn_indices(X, n_neighbors)
knn_indices = np.argsort(X)[:, :n_neighbors]
knn_indices = fast_knn_indices(X, n_neighbors)
# knn_indices = np.argsort(X)[:, :n_neighbors]
# Compute the nearest neighbor distances
# (equivalent to np.sort(X)[:,:n_neighbors])
knn_dists = X[np.arange(X.shape[0])[:, None], knn_indices].copy()
Expand Down

0 comments on commit 7900d14

Please sign in to comment.