Skip to content

Commit 3bf4d6e

Browse files
Updated false positve and false negative rate functions in functional.py (#855)
false positve and false negative rate functions to increase clarity for further usage, the two functions can be derived from already written sensitivity and specificity functions. Merging these into single ones, will help user to generalize all the metrics easily.
1 parent b081758 commit 3bf4d6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

segmentation_models_pytorch/metrics/functional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,11 @@ def _negative_predictive_value(tp, fp, fn, tn):
344344

345345

346346
def _false_negative_rate(tp, fp, fn, tn):
347-
return fn / (fn + tp)
347+
return 1 - _sensitivity(tp, fp, fn, tn)
348348

349349

350350
def _false_positive_rate(tp, fp, fn, tn):
351-
return fp / (fp + tn)
351+
return 1 - _specificity(tp, fp, fn, tn)
352352

353353

354354
def _false_discovery_rate(tp, fp, fn, tn):

0 commit comments

Comments
 (0)