Skip to content
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

Merged
merged 14 commits into from Jun 23, 2020

Conversation

gbolmier
Copy link
Contributor

@gbolmier gbolmier commented May 7, 2020

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

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
@amueller
Copy link
Member

Should we have some basic tests that the heuristic is actually used?

doc/modules/neighbors.rst Outdated Show resolved Hide resolved
@amueller
Copy link
Member

ping @rth ?

Copy link
Member

@rth rth left a 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:.

doc/modules/neighbors.rst Outdated Show resolved Hide resolved
@gbolmier
Copy link
Contributor Author

Please add an entry to the change log at doc/whats_new/v0.23.rst.

You meant doc/whats_new/v0.24.rst right?

Add the previous heuristic to the new one instead of latter replacing the former. Update test and user guide.
@gbolmier gbolmier changed the title [MRG] Update NearestNeighbors 'auto' heuristic [MRG] Update NeighborsBase 'auto' heuristic May 14, 2020
doc/modules/neighbors.rst Outdated Show resolved Hide resolved
doc/modules/neighbors.rst Outdated Show resolved Hide resolved
Copy link
Member

@rth rth left a 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..

@rth rth merged commit 62fc8bb into scikit-learn:master Jun 23, 2020
rubywerman pushed a commit to MLH-Fellowship/scikit-learn that referenced this pull request Jun 24, 2020
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
@gbolmier gbolmier deleted the nn_heuristic branch November 15, 2020 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heuristics for algorithm='auto' in NearestNeighbors
3 participants