Commit 6ad86967 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'bpcer_threshold_criteria' into 'master'

Bpcer threshold criteria

See merge request !61
parents 4e89bcb3 a249011c
Pipeline #30569 canceled with stages
in 1 minute and 49 seconds
......@@ -5,7 +5,7 @@
import bob.measure
import numpy
from bob.measure import far_threshold, eer_threshold, min_hter_threshold, farfrr
from bob.measure import far_threshold, eer_threshold, min_hter_threshold, farfrr, frr_threshold
from bob.bio.base.score.load import four_column
from collections import defaultdict
import re
......@@ -17,7 +17,7 @@ def calc_threshold(method, pos, negs, all_negs, far_value=None, is_sorted=False)
Parameters
----------
method : str
One of ``bpcer20``, ``eer``, ``min-hter``.
One of ``bpcer20``, ``eer``, ``min-hter``, ``apcer20``.
pos : array_like
The positive scores. They should be sorted!
negs : list
......@@ -45,6 +45,9 @@ def calc_threshold(method, pos, negs, all_negs, far_value=None, is_sorted=False)
if "bpcer" in method:
desired_apcer = 1 / float(method.replace("bpcer", ""))
threshold = apcer_threshold(desired_apcer, pos, *negs, is_sorted=is_sorted)
elif "apcer" in method:
desired_bpcer = 1 / float(method.replace("apcer", ""))
threshold = frr_threshold(all_negs, pos, desired_bpcer, True)
elif method == "far":
threshold = far_threshold(all_negs, pos, far_value, is_sorted=is_sorted)
elif method == "eer":
......
......@@ -29,6 +29,18 @@ CRITERIA = (
"bpcer5",
"bpcer2",
"bpcer1",
"apcer5000",
"apcer2000",
"apcer1000",
"apcer500",
"apcer200",
"apcer100",
"apcer50",
"apcer20",
"apcer10",
"apcer5",
"apcer2",
"apcer1",
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment