[ENH] KNN n_jobs and updated kneighbours method#2578
Conversation
Thank you for contributing to
|
|
For both the KNNClassifier and KNNRegressor I've replaced the _kneighbors function with a public kneighbors. There are two reasons I have made this change:
|
|
Interested to see how this compares to the current threading. |
…ded testing with comments

Reference Issues/PRs
This PR depends on #2545
What does this implement/fix? Explain your changes.
This PR passes n_jobs to the pairwise distance function so that is now can run on multiple threads. In addition I changed the k_neighbors method to be compatible with sklearns which can be used in various ways. See: https://github.com/scikit-learn/scikit-learn/blob/98ed9dc73/sklearn/neighbors/_base.py#L763.
Does your contribution introduce a new dependency? If yes, which one?
Any other comments?
PR checklist
For all contributions
For new estimators and functions
__maintainer__at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.For developers with write access