Skip to content

How to calculate AUC over an entire test set? #9845

Discussion options

You must be logged in to vote

averaging auc won't give the correct metric over the entire dataset plus you might get some error in case you have all targets of the same label which is possible in case of a single batch. To avoid this you can checkout https://torchmetrics.readthedocs.io/en/stable/references/modules.html#auroc. It will calculate the metrics the right way for you and you don't have to take care of averaging/accumulation or anything. There are different subpackage for each metric: module and functional. For your use-case I'd suggest using module one.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by EvanZ
Comment options

You must be logged in to vote
7 replies
@rohitgr7
Comment options

@EvanZ
Comment options

@rohitgr7
Comment options

@EvanZ
Comment options

@rohitgr7
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment