Specificity if TN + FN = 0
lukazso opened this issue · comments
The specificity is defined as
The docs say that in case
Is this really intended? It might be a weird edge case. But from the metric definition, I see no argument why the metric should not be defined in case there are no positive samples in the data. In case
torchmetrics
version: 1.3.2
torchmetrics/src/torchmetrics/classification/specificity.py
Lines 450 to 459 in c1f8334
I just saw that this might be just a documentation issue. The classes BinarySpecificity
, MulticlassSpecificity
, and Multilabelspecificity
all have the correct description:
torchmetrics/src/torchmetrics/classification/specificity.py
Lines 31 to 39 in c1f8334
Also, the implementation seems to follow this definition.