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
Conversation
Co-Authored-By: Joel Nothman <joel.nothman@gmail.com>
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.
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.
@rick2047 thanks for your contrib. I pushed a non-regression test for you because we want to get 0.21.1 out soon. |
@jnothman merge? |
Thanks @rick2047! |
@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. |
Congrats @rick2047! |
… with binary metrics and Y is None (scikit-learn#13864)
… with binary metrics and Y is None (scikit-learn#13864)
… with binary metrics and Y is None (scikit-learn#13864)
Reference Issues/PRs
Fixes #13853.
Fixed by using lazy or evaluation. Check if Y is none, if not none then check if its bool.