mobgap.pipeline.evaluation.abs_rel_error#
- mobgap.pipeline.evaluation.abs_rel_error(
- df: DataFrame,
- reference_col_name: str = 'reference',
- detected_col_name: str = 'detected',
- zero_division_hint: Literal['warn', 'raise'] | float = 'warn',
Calculate the absolute relative error between the detected and reference values.
- Parameters:
- df
The DataFrame containing the reference and detected values.
- reference_col_name
The identifier of the column containing the reference values.
- detected_col_name
The identifier of the column containing the detected values.
- zero_division_hint
How to handle zero division errors. Can be one of “warn” (warning is given, respective values are set to NaN), “raise” (error is raised), or “np.nan” (respective values are silently set to NaN).
- Returns:
- abs_rel_error
The absolute relative error between the detected and reference values in the form
abs((detected - reference) / reference).