lir.metrics package
Submodules
lir.metrics.devpav module
- lir.metrics.devpav.devpav(llrs: ndarray, y: ndarray) float
Calculates devPAV for LR data under H1 and H2.
lir.metrics.overestimation module
- lir.metrics.overestimation.llr_overestimation(llrs: ndarray, y: ndarray, **kwargs: Any) float
Calculates the mean absolute value of the LLR-overestimation.
Module contents
- lir.metrics.cllr(llr_data: LLRData, weights: tuple[float, float] = (1, 1)) float
Calculate a log likelihood ratio cost (C_llr) for a series of log likelihood ratios.
Nico Brümmer and Johan du Preez, Application-independent evaluation of speaker detection, In: Computer Speech and Language 20(2-3), 2006.
- Parameters:
llr_data – LLRs and their metadata, wrapped in an LLRData object
weights – the relative weights of the classes
- Returns:
CLLR, the log likelihood ratio cost
- lir.metrics.cllr_cal(llr_data: LLRData, weights: tuple[float, float] = (1, 1)) float
Calculate the difference between the C_llr before and after isotonic calibration.
- Parameters:
llr_data – LLRs and their metadata, wrapped in an LLRData object
weights – the relative weights of the classes
- Returns:
CLLR_cal, the difference after isotonic calibration
- lir.metrics.cllr_min(llr_data: LLRData, weights: tuple[float, float] = (1, 1)) float
Estimate the discriminative power from a collection of log likelihood ratios.
- Parameters:
llr_data – LLRs and their metadata, wrapped in an LLRData object
weights – the relative weights of the classes
- Returns:
CLLR_min, a measure of discrimination
- lir.metrics.llr_lower_bound(llrs: LLRData) float | None
Provide corresponding lower bound for provided LLR data.
When an LLRData object contains a lower bound, return it. If not, return None.
- Parameters:
llrs – LLRs and their metadata, wrapped in an LLRData object
- Returns:
the LLR lower bound, or None
- lir.metrics.llr_upper_bound(llrs: LLRData) float | None
Provide corresponding upper bound for provided LLR data.
When an LLRData object contains an upper bound, return it. If not, return None.
- Parameters:
llrs – LLRs and their metadata, wrapped in an LLRData object
- Returns:
the LLR upper bound, or None