Skip to content

Commit

Permalink
add missing condition for lesion ppv and f1_score
Browse files Browse the repository at this point in the history
  • Loading branch information
naga-karthik committed Oct 18, 2024
1 parent e093be2 commit 250983f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions MetricsReloaded/metrics/pairwise_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,9 @@ def lesion_f1_score(self):
elif not self.flag_empty_ref and self.flag_empty_pred:
# Reference is not empty, prediction is empty --> model did not learn correctly (it's false negative)
return 0.0
elif self.flag_empty_ref and not self.flag_empty_pred:
# Reference is empty, prediction is not empty --> model did not learn correctly (it's false positive)
return 0.0
# if the predction is not empty and ref is empty, it's false positive
# if both are not empty, it's true positive
else:
Expand Down Expand Up @@ -1285,6 +1288,9 @@ def lesion_ppv(self):
elif not self.flag_empty_ref and self.flag_empty_pred:
# Reference is not empty, prediction is empty --> model did not learn correctly (it's false negative)
return 0.0
elif self.flag_empty_ref and not self.flag_empty_pred:
# Reference is empty, prediction is not empty --> model did not learn correctly (it's false positive)
return 0.0
# if the predction is not empty and ref is empty, it's false positive
# if both are not empty, it's true positive
else:
Expand Down

0 comments on commit 250983f

Please sign in to comment.