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
[MRG] Update NeighborsBase 'auto' heuristic #17148
Conversation
Change for tree-based methods when available and number of features <= 15 otherwise brute force. Fix test using `algorithm='auto'` assuming 'auto' will select 'brute'. Update "1.6.4.4. Choice of Nearest Neighbors Algorithm" user guide section. Resolves: scikit-learn#8213
Should we have some basic tests that the heuristic is actually used? |
ping @rth ? |
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.
Two comments otherwise LGTM. Thanks @gbolmier !
Please add an entry to the change log at doc/whats_new/v0.23.rst
. Like the other entries there, please reference this pull request with :pr:
and credit yourself with :user:
.
You meant |
Add the previous heuristic to the new one instead of latter replacing the former. Update test and user guide.
Rephrase with bullets for readability
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 @gbolmier , LGTM.
Don't hesitate to ping on PRs in general, I though this one was already merged..
Reference Issues/PRs
Fixes #8213
What does this implement/fix? Explain your changes.
Fix the current
NearestNeighbors
'auto' heuristic which fails when the number of features is too high.This change propose to choose tree-based methods when available and number of features doesn't exceed 15, otherwise to choose brute force.
Additional context
Benchmarks run and analysed here.
Read also #8213 discussion