-
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
Incorrect result in computing MulticlassRecall
macro average when ignore_index
is specified
#2441
Open
JeroenMandersloot opened this issue
Mar 8, 2024
· 5 comments
· Fixed by rittik9/torchmetrics#1 · May be fixed by #2443 or #2710
Open
Incorrect result in computing MulticlassRecall
macro average when ignore_index
is specified
#2441
JeroenMandersloot opened this issue
Mar 8, 2024
· 5 comments
· Fixed by rittik9/torchmetrics#1 · May be fixed by #2443 or #2710
Comments
JeroenMandersloot
added
bug / fix
Something isn't working
help wanted
Extra attention is needed
labels
Mar 8, 2024
Hi! thanks for your contribution!, great first issue! |
JeroenMandersloot
changed the title
Error in computing
Incorrect result in computing Mar 8, 2024
MulticlassRecall
macro average when ignore_index
is specifiedMulticlassRecall
macro average when ignore_index
is specified
4 tasks
This issue has been there for a while. After v0.9.3, |
thank you for the adjustment, would yo be interested in sending a PR? |
Pls assign it to me @Borda |
cc: @SkafteNicki |
This was referenced Sep 1, 2024
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug
Specifying the
ignore_index
argument inMulticlassRecall
leads to incorrect results when computing the macro average.To Reproduce
Expected behavior
In the toy example above there are two classes (0 and 1) and two instances of each class. I want to ignore class 0 altogether (hence
ignore_index=0
), so I would expect the first two predictions to be ignored entirely (since they relate to class 0 instances). Of the remaining two predictions only one is correct, so I would expect the recall score to be0.5
.However, the actual result is
0.25
. It looks as if the recall score for theignore_index
class is simply set to 0 before computing the average, causing the average to be computed as(0 + 0.5) / 2
instead of0.5 / 1
.Environment
The text was updated successfully, but these errors were encountered: