Skip to content
Snippets Groups Projects
Commit 5c508b9a authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Merge branch 'far_1_fix' into 'master'

Fixed issue with FAR and FRR values being exactly 1 or 0, respectively

See merge request !41
parents c970a982 5398a4a7
No related branches found
No related tags found
1 merge request!41Fixed issue with FAR and FRR values being exactly 1 or 0, respectively
Pipeline #
...@@ -125,7 +125,7 @@ double bob::measure::farThreshold(const blitz::Array<double, 1> &negatives, ...@@ -125,7 +125,7 @@ double bob::measure::farThreshold(const blitz::Array<double, 1> &negatives,
// compute position of the threshold // compute position of the threshold
double crr = 1. - far_value; // (Correct Rejection Rate; = 1 - FAR) double crr = 1. - far_value; // (Correct Rejection Rate; = 1 - FAR)
double crr_index = crr * neg.extent(0) - 1.; double crr_index = std::max(crr * neg.extent(0) - 1., 0.);
// compute the index above the current CRR value // compute the index above the current CRR value
int index = (int)std::ceil(crr_index); int index = (int)std::ceil(crr_index);
...@@ -163,7 +163,7 @@ double bob::measure::frrThreshold(const blitz::Array<double, 1> &, ...@@ -163,7 +163,7 @@ double bob::measure::frrThreshold(const blitz::Array<double, 1> &,
sort(positives, pos, is_sorted); sort(positives, pos, is_sorted);
// compute position of the threshold // compute position of the threshold
double frr_index = frr_value * pos.extent(0) - 1.; double frr_index = std::max(frr_value * pos.extent(0) - 1., 0.);
// compute the index below the current FAR value // compute the index below the current FAR value
int index = (int)std::ceil(frr_index); int index = (int)std::ceil(frr_index);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment