[WIP] algorithm='auto' should always work for nearest neighbors#7669
[WIP] algorithm='auto' should always work for nearest neighbors#7669maniteja123 wants to merge 2 commits intoscikit-learn:masterfrom
Conversation
| for metric in VALID_METRICS['brute']: | ||
| nn = neighbors.NearestNeighbors(n_neighbors=3, algorithm='auto', | ||
| metric=metric).fit(X) | ||
| assert_true(nn._fit_method, 'brute') |
There was a problem hiding this comment.
shouldn't it be enough to make sure no error is raised? I don't understand this test. The other metrics might also support this metric.
|
These all take additional parameters, so they neither work for the trees or the brute algorithm, right? We might want to remove the distances that require a parameter from |
|
actually, we should make make the dict from |
|
Thanks for the review and suggestions @amueller. Will look at those issues and understand it better before doing the changes. |
|
fixed by #9145. |
Solves #4931. Continues work done in #5596
What does this implement/fix? Explain your changes.
'auto' should default to 'brute' when trees do not support the metric.
Any other comments?
Right now, the tests are failing on metric
mahalnobis,seuclideanandwminkowski. Please do have a look and let me know if there is any particular reason for the failing tests.