Commit be298005 authored by Anjith GEORGE's avatar Anjith GEORGE

WIP, bpcer thresholds

parent 4e89bcb3
Pipeline #30565 canceled with stage
in 8 minutes and 30 seconds
......@@ -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