mobgap.pipeline.evaluation.rel_error#
- mobgap.pipeline.evaluation.rel_error(
- df: DataFrame,
- reference_col_name: str = 'reference',
- detected_col_name: str = 'detected',
- zero_division_hint: Literal['warn', 'raise'] | float = 'warn',
Calculate the 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:
- rel_error
The relative error between the detected and reference values in the form (
detected-reference) /reference.