-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix variation_of_information #4875
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 variation_of_information #4875
Conversation
This reverts commit db38358.
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.
Very clever! I really like your reimplementation, though it took me a bit longer to find the actually relevant change. =P
I don't really like that you changed ignore_labels
to None, but I won't hold up the PR over it. =P
Not sure why pooch is failing in some builds with:
I guess we can ignore as not relevant to this PR! |
Thank you @jni, sorry for changing the value of |
data[ignored] = 0 | ||
if ignore_labels is None: | ||
ignore_labels = [] | ||
im_test_r = im_test.reshape(-1) |
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.
just curious to know why you changed im.ravel()
to im.reshape(-1)
?
(it's just for my own curiosity, no problem with the proposal)
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.
@emmanuelle The answer is in the .ravel docstring: .reshape is less likely to result in a copy. Which surprised me but after several reminders @rfezzani has finally hammered it into my brain.
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.
now that you say it I'm almost sure I already asked @rfezzani this same question. Thanks for answering, we're doing group learning here :-).
Thanks @rfezzani, merging. |
Description
Fixes #4856
The original bug is in the contingency table normalization.
Checklist
./doc/examples
(new features only)./benchmarks
, if your changes aren't covered by anexisting benchmark
For reviewers
later.
__init__.py
.doc/release/release_dev.rst
.