Hello,
I want to get the nearest neighbours for each point in the dataset. I notice from the results of knn_query that the neighbour list for some points does not contain their own index while most points have their own index as the first nearest neighbour. My code is given below
p.init_index(max_elements = num_elements, ef_construction = 200, M = 16)
p.set_ef(10)
p.set_num_threads(12)
p.add_items(input_2d_vector)
nn = 15
labels, distance = p.knn_query(input_2d_vector, k=nn)
Ideally, the first index should be 159954 instead of 100278 given that the self distance of 159954 is zero. Is it an expected behavior or am I missing something?
Hello, I want to get the nearest neighbours for each point in the dataset. I notice from the results of
knn_query
that the neighbour list for some points does not contain their own index while most points have their own index as the first nearest neighbour. My code is given belowExample: result of a query index 159954
Ideally, the first index should be 159954 instead of 100278 given that the self distance of 159954 is zero. Is it an expected behavior or am I missing something?
Any help is much appreciated.
Thank you.