-
Notifications
You must be signed in to change notification settings - Fork 408
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 macro when ignore_index
is set
#2163
base: master
Are you sure you want to change the base?
Conversation
ignore_index
is set
@@ -416,6 +416,8 @@ def _multiclass_stat_scores_update( | |||
fp = confmat.sum(0) - tp | |||
fn = confmat.sum(1) - tp | |||
tn = confmat.sum() - (fp + fn + tp) | |||
if ignore_index is not None: | |||
fp[ignore_index] = 0 |
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.
this is probably correct, but since many metrics derive from the stat_scores
class that means that basically all would need to have their unittests fixed
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.
what do you mean by it needs to be fixed?
@edumotya how is it going, mind checking comment from Nicki |
@edumotya seems like most of the tests are off; could you pls check it... |
sure @Borda, I am sorry for the late response. It might take me some time, it is not straightforward to fix the affected tests, I'll do my best |
Any update? |
d0a5568
to
9fc79ae
Compare
I think this is related #2710 |
What does this PR do?
Fixes #1691
Additionally, tests have been updated to exclude the ignored class from the macro accuracy averaging.
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃
📚 Documentation preview 📚: https://torchmetrics--2163.org.readthedocs.build/en/2163/