-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] Fix NearestNeighbors algorithm='auto' to work with all supported metrics by default #5596
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
Conversation
Can you add tests? |
Ya, working on it |
Shall we update the docstring as well? |
Yes the docstring needs to be updated. I changed the title of this PR to make it more explicit. @pradyu1993 please add a |
@MechCoder can you review the PR |
Please also test with sparse matrix input |
63ad4e4
to
b969bf6
Compare
@jnothman Done |
I intended that you would check that metrics which are supported for dense data but not for sparse data will still work in auto. Or is that covered in another test? |
@MechCoder can you review the PR |
Xcsr = csr_matrix(X) | ||
Valid_Metrics = dict(dense = ['precomputed', 'sqeuclidean', | ||
'yule', 'cosine', 'correlation'], | ||
sparse=PAIRWISE_DISTANCE_FUNCTIONS.keys()) |
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.
You can do away with this and just check for VALID_METRICS['brute']
and VALID_METRICS_SPARSE['brute']
. I think the other options are checked already.
Thanks ! Just some minor comments. And then +1 But you might have to wait till after the holiday season for the second ^.^ |
@pradyu1993 are you still working on this? |
This is up for grabs by a contributor as far as I'm concerned. |
I'd rather this be patched separate to #7590... On 11 October 2016 at 17:47, Maniteja Nandana notifications@github.com
|
👍 for small PRs, also they seem pretty unrelated (or I'm missing something, which is entirely plausible after reading like 5000 notifications this week) |
fixed by #9145. |
#4931