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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ignore_index option to Accuracy metric #61

Closed
stas-sl opened this issue Mar 9, 2021 · 8 comments
Closed

Add ignore_index option to Accuracy metric #61

stas-sl opened this issue Mar 9, 2021 · 8 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@stas-sl
Copy link

stas-sl commented Mar 9, 2021

馃殌 Feature

It would be nice if Accuracy metric accepted ignore_index as it works for StatsScore or torch.nn.CrossEntropyLoss

@Borda Borda transferred this issue from Lightning-AI/pytorch-lightning Mar 12, 2021
@github-actions
Copy link

Hi! thanks for your contribution!, great first issue!

@avinashsai
Copy link

Hi,
Anyone working on this? I can try the implementation.

@SkafteNicki
Copy link
Member

@avinashsai please feel free to do so :]
Ping me either here or on slack if you need any help.

@avinashsai
Copy link

@SkafteNicki I have a query:
This ignore_index should ignore that class label and calculate accuracy for the rest?
Ex: y_pred - [1, 0, 1, 1, 0], y_true - [1, 0, 0, 1, 0]

Accuracy(y_pred, y_true, ignore_index=0) = 100%
Ignoring class label '0', there are only two samples belonging to class '1' and hence accuracy is 100%.

@SkafteNicki
Copy link
Member

@avinashsai that at least how I would like the argument to work, as it is similar to how torch.nn.CrossEntropyLoss works.

@Borda Borda added enhancement New feature or request help wanted Extra attention is needed labels Mar 17, 2021
@SkafteNicki
Copy link
Member

@avinashsai how is it going here?

@avinashsai
Copy link

@SkafteNicki I am working on it. Will submit PR in a couple of days.

@SkafteNicki
Copy link
Member

Closed by #166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants