Commit 200c7252 authored by Julien Jerphanion's avatar Julien Jerphanion

Simplify Minimal Reproducible Example

parent 1ff05f71
import kdtree
import numpy as np
from sklearn import neighbors
if __name__ == "__main__":
X = np.load("X.npy")
tree = kdtree.KDTree()
n_query = 10
k = 3
rng = np.random.RandomState(0)
Y = rng.rand(n_query, X.shape[1])
knn_indices = np.zeros((n_query, k), dtype=np.int32)
knn_distances = np.zeros((n_query, k), dtype=np.float64)
tree.query(Y, knn_indices, knn_distances)
# print(knn_distances)
sktree = neighbors.KDTree(X, leaf_size=256)
knn_distances, knn_indices = sktree.query(Y, k=k, return_distance=True)
# print(knn_distances)
This diff is collapsed.
Subproject commit 33678cf7a06ea219cfcfc9027c4d47ab4c519c13
Subproject commit 4e6e7c2bb8a149984ccdbe72b851ab5975769a13
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment