From b95b16d8eece96d2996bcefa6b07ef543c44c159 Mon Sep 17 00:00:00 2001 From: Vinay Kumar Verma Date: Thu, 29 Feb 2024 13:56:41 +0530 Subject: [PATCH] Updated false positve and false negative rate functions in functional.py 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. --- segmentation_models_pytorch/metrics/functional.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/segmentation_models_pytorch/metrics/functional.py b/segmentation_models_pytorch/metrics/functional.py index adeb1d97..4ffa4294 100644 --- a/segmentation_models_pytorch/metrics/functional.py +++ b/segmentation_models_pytorch/metrics/functional.py @@ -344,11 +344,11 @@ def _negative_predictive_value(tp, fp, fn, tn): def _false_negative_rate(tp, fp, fn, tn): - return fn / (fn + tp) + return 1 - _sensitivity(tp, fp, fn, tn) def _false_positive_rate(tp, fp, fn, tn): - return fp / (fp + tn) + return 1 - _specificity(tp, fp, fn, tn) def _false_discovery_rate(tp, fp, fn, tn):