espnet2.utils.eer.ComputeMinDcf
Less than 1 minute
espnet2.utils.eer.ComputeMinDcf
espnet2.utils.eer.ComputeMinDcf(fnrs, fprs, thresholds, p_target, c_miss, c_fa)
Computes the minimum of the detection cost function.
This function calculates the minimum detection cost function (min DCF) based on the provided false negative rates (fnrs), false positive rates (fprs), decision thresholds, the prior probability of the target speaker (p_target), and the costs associated with false negatives (c_miss) and false positives (c_fa). The computation follows the methodology outlined in the NIST 2016 Speaker Recognition Evaluation Plan.
- Parameters:
- fnrs (list of float) – A list of false negative rates corresponding to different thresholds.
- fprs (list of float) – A list of false positive rates corresponding to different thresholds.
- thresholds (list of float) – A list of decision thresholds.
- p_target (float) – The prior probability of the target speaker. This should be a value between 0 and 1.
- c_miss (float) – The cost associated with a false negative error.
- c_fa (float) – The cost associated with a false positive error.
- Returns: A tuple containing: : - min_dcf (float): The minimum detection cost function value.
- min_c_det_threshold (float): The decision threshold that results in the minimum detection cost.
- Return type: tuple
Examples
>>> fnrs = [0.1, 0.2, 0.3]
>>> fprs = [0.2, 0.1, 0.3]
>>> thresholds = [0.1, 0.2, 0.3]
>>> p_target = 0.5
>>> c_miss = 1.0
>>> c_fa = 1.0
>>> min_dcf, min_threshold = ComputeMinDcf(fnrs, fprs, thresholds,
... p_target, c_miss, c_fa)
>>> print(min_dcf, min_threshold)
NOTE
The function assumes that the lengths of fnrs, fprs, and thresholds are all the same.