Back to fast_knn_indices as long as we have python>=3.6
@@ -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()
