From e5b113595e78083b2b6d94fc31f2a0dc33076f5c Mon Sep 17 00:00:00 2001 From: Lukas Ewecker <61707855+lukazso@users.noreply.github.com> Date: Wed, 10 Apr 2024 10:15:26 +0200 Subject: [PATCH] docs: fix specificity when metric is not defined (#2491) Co-authored-by: Lukas Ewecker --- src/torchmetrics/classification/specificity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torchmetrics/classification/specificity.py b/src/torchmetrics/classification/specificity.py index a297cfe9ca5..caca10dfa2b 100644 --- a/src/torchmetrics/classification/specificity.py +++ b/src/torchmetrics/classification/specificity.py @@ -453,7 +453,7 @@ class Specificity(_ClassificationTaskWrapper): .. math:: \text{Specificity} = \frac{\text{TN}}{\text{TN} + \text{FP}} Where :math:`\text{TN}` and :math:`\text{FP}` represent the number of true negatives and false positives - respectively. The metric is only proper defined when :math:`\text{TP} + \text{FP} \neq 0`. If this case is + respectively. The metric is only proper defined when :math:`\text{TN} + \text{FP} \neq 0`. If this case is encountered for any class/label, the metric for that class/label will be set to 0 and the overall metric may therefore be affected in turn.