Lightning-AI / Lightning-AI/torchmetrics

Clarify that nan is supported in zero_division

Open
#2,535 4 comments 0 reactions 1 assignee View on GitHub

@SkafteNicki is already working on this.

Since May 14, 2024.

documentation enhancement v1.3.x
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.