-
-
Notifications
You must be signed in to change notification settings - Fork 25.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX Fallback to ball_tree using minkowski with w for kd_tree #22241
FIX Fallback to ball_tree using minkowski with w for kd_tree #22241
Conversation
This is follow-up for scikit-learn#21741.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I think Minkowski
with non None w
should rather fallback to ball_tree
in low dim as explained below.
Other than that a few nitpicks and LGTM.
Somewhat related to #21873 about making the scikit-learn implementation consistent with the new scipy parametrization (for discoverability when reviewing). |
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, assuming CI is green with the latest change.
There is just a skip case from a previous version of the PR that seems no longer necessary:
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
I wonder if this can help fix #22257 with the development versions of numpy/scipy. |
Let me try in a new conda env with the latest nightly buids of scipy:
|
I confirm this PR fixes #22257 ! 🥳🎉 |
« D'une pierre, deux coups. » 🤙 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the usual nitpick:wink:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit, otherwise LGTM
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com>
Co-authored-by: Christian Lorentzen <lorentzen.ch@gmail.com> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Reference Issues/PRs
This is follow-up for #21741.
What does this implement/fix? Explain your changes.
Add better test coverage for weighted minkowski when
KDTree
is used forkneighbors
.Fallback to
BallTree
.