Skip to content

Commit

Permalink
Updated false positve and false negative rate functions in functional…
Browse files Browse the repository at this point in the history
….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.
  • Loading branch information
vermavinay982 authored Apr 30, 2024
1 parent b081758 commit 3bf4d6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions segmentation_models_pytorch/metrics/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 3bf4d6e

Please sign in to comment.