Closed pj-mathematician closed 2 years ago
@pj-mathematician This is indeed a bug in the algorithm selection, since the rbc
algorithm should not be used when k >= sqrt(n), we should be defaulting to brute force but it's not currently doing that. In the meantime, you should be able to use the argument algorithm='brute'
when constructing the NearestNeighbors
estimator to get around this bug.
This issue has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d
if there is no activity in the next 60 days.
Handling this edge case of algorithm selection is probably a good first issue
@beckernick i could be wrong but I believe this issue might have actually been fixed in a more recent PR (it now will select brute force in this case or throw an error if rbc was selected explicitly)
Describe the bug
When trying to get kneighbors using the algorithms provided in cuml.neighbors, it works for n_neighbors less than half of total samples, and throws error otherwise.
Steps/Code to reproduce bug
I have tested this for all the algorithms present as of now in cuml.neighbors, and each of them throw the same error.
Each of them throwing the error:
Taking
N < 3
works perfectly.Expected behavior Running the same code using sklearn.neighbors algorithms return expected results.
returns:
Environment details (please complete the following information):
Additional context Add any other context about the problem here.