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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-label ROCs #103

Closed
FlorianMF opened this issue Mar 17, 2021 · 2 comments · Fixed by #114
Closed

Multi-label ROCs #103

FlorianMF opened this issue Mar 17, 2021 · 2 comments · Fixed by #114
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@FlorianMF
Copy link

🚀 Feature

Similary to issue #100 it would be nice to be able to make roc work with multi-label inputs.

Motivation & Pitch

auc and hence _auroc_compute do work with multi-label inputs and return a AUROC value for each label/class by iterating over range(num_classes) when passing average=None.
_roc_compute and hence roc differentiate only between binary and multi-class (by checking if num_classes == 1)

I would expect _roc_update to similarly return a mode using _input_format_classification(preds, target) and return a list of [fpr, tpr, threshold] of length=num_classes.
The easiest would be the format [[fpr, tpr, thres]]*5

@FlorianMF FlorianMF added enhancement New feature or request help wanted Extra attention is needed labels Mar 17, 2021
@github-actions
Copy link

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

@FlorianMF
Copy link
Author

a possible implementation would be :

if mode == 'binary':
   ...
elif mode == 'multi-label':
    output= [roc(preds=preds[:, i],
             target=target[:, i],
             num_classes=1,
             pos_label=1,
             sample_weights=sample_weights)
                      for i in range(num_classes]
     fpr = [o[0] for o in output]
     tpr = [o[1] for o in output]
     thresholds= [o[2] for o in output]
else:
...

@SkafteNicki SkafteNicki self-assigned this Mar 23, 2021
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.

2 participants