tensorflow / tensorflow/model-analysis
`GenericChangeThreshold` relative validation inconsistency
@jeelania10 is already working on this.
Since Sep 2, 2026.
- Dominant language
- Python
- Stars
- 1.3k
- Forks
- 280
- PR merge metrics
- No merged PRs in 30d
Description
The implementation of relative threshold validation doesn't align with the documented/expected behaviour.
From the docs:
Aboslute change is calculated as the value diference between the metrics of the candidate and baseline model, namely, v_c - v_b where v_c denotes the candidate metric value and v_b denotes the baseline value. Relative value is the relative difference between the metric of the candidate and the baseline, namely, v_c/v_b.
However, the implementation instead calculates (v_c - v_b) / v_b, NOT v_c/v_b as the docs very clearly state.
https://github.com/tensorflow/model-analysis/blob/422dbd37b31e286bda3311028b5d9ff7b76df7ac/tensorflow_model_analysis/evaluators/metrics_validator.py#L88
The easiest fix would be to update the docs to correctly describe the implementation, but I'm not sure what the desired behaviour actually is.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.