Lightning-AI / Lightning-AI/torchmetrics
Clarify that nan is supported in zero_division
@SkafteNicki is already working on this.
Since May 14, 2024.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 526
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 5
Description
This option added in https://github.com/Lightning-AI/torchmetrics/pull/2198 to create equivalence with [sklearn](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html#sklearn-metrics-precision-score) also supports passing through a nan if I am not mistaken, based on the implementation of `torchmetrics.utilities.compute._safe_divide`.
I wanted to clarify that nan can indeed be passed through, ask if any code changed are required to support this officially, and suggest this could be added to the docs which state currently `zero_division [float] – Should be 0 or 1.`, e.g. [here](https://lightning.ai/docs/torchmetrics/v1.4.0/classification/precision.html#binary-precision)
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.