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

Fix for AttributeError thrown when calling metrics.pairwise_distances with binary metrics and Y is None #13864

Merged
merged 6 commits into from May 13, 2019

Conversation

rick2047
Copy link
Contributor

Reference Issues/PRs

Fixes #13853.
Fixed by using lazy or evaluation. Check if Y is none, if not none then check if its bool.

@jnothman jnothman added this to the 0.21.1 milestone May 12, 2019
Co-Authored-By: Joel Nothman <joel.nothman@gmail.com>
Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a non-regression test to sklearn/metrics/tests/test_pairwise.py

Please don't make assorted PEP8 changes there as you have here... it makes it harder to review the content of your PR.

@ogrisel
Copy link
Member

ogrisel commented May 13, 2019

@rick2047 thanks for your contrib. I pushed a non-regression test for you because we want to get 0.21.1 out soon.

@ogrisel
Copy link
Member

ogrisel commented May 13, 2019

@jnothman merge?

@jnothman jnothman merged commit c7ce675 into scikit-learn:master May 13, 2019
@jnothman
Copy link
Member

Thanks @rick2047!

@rick2047
Copy link
Contributor Author

@jnothman oh I'm so excited right now. You have no idea. I've tried for years to actually get some code committed an open source project. This is brilliant.

@ogrisel
Copy link
Member

ogrisel commented May 13, 2019

Congrats @rick2047!

jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request May 14, 2019
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request May 14, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError thrown when calling metrics.pairwise_distances with binary metrics and Y is None
3 participants