Skip to content

[MRG] Update NeighborsBase 'auto' heuristic - #17148

Merged
rth merged 14 commits into
scikit-learn:masterfrom
gbolmier:nn_heuristic
Jun 23, 2020
Merged

rth merged 14 commits into
scikit-learn:masterfrom
gbolmier:nn_heuristic

Conversation

@gbolmier

@gbolmier gbolmier commented May 7, 2020 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

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

Comment thread doc/modules/neighbors.rst Resolved
@amueller

Copy link
Copy Markdown
Member

ping @rth ?

@rth rth left a comment

Copy link
Copy Markdown
Member

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:.

Comment thread doc/modules/neighbors.rst Resolved
@gbolmier

Copy link
Copy Markdown
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?

gbolmier added 2 commits May 14, 2020 00:41
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
Comment thread doc/modules/neighbors.rst Resolved
Comment thread doc/modules/neighbors.rst Resolved

@rth rth left a comment •

Copy link
Copy Markdown
Member

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