Skip to content

Mutliclass Precision Recall Curve, docs not consistent with execution #203

Open
@brynhayder

Description

📚 The doc issue

Here the examples in the documentation shows that the output precisions and thresholds have the same length, but the recalls are one element longer

https://pytorch.org/torcheval/main/generated/torcheval.metrics.functional.multilabel_precision_recall_curve.html#torcheval.metrics.functional.multilabel_precision_recall_curve

However, in my execution the precisions and recalls are the same length (as expected) and the thresholds one element shorter.

Moreover, I see that the missing element in thresholds possibly comes from the use of diff to calculate, but shouldn't there be the same number of elements in each of the arrays output? Aren't P and R functions of threshold?

Suggest a potential alternative/fix

No response

Activity

brynhayder

brynhayder commented on Aug 13, 2024

@brynhayder
Author

Seems from here that you're appending values to the end of the precisions and recalls for graphical purposes, hence the discrepancy in number of elements I describe above. I didn't notice this anywhere in the documentation.

IMO, coming from the principle of least surprise, it would be better to remove this and leave it to the user to append these values if they want their charts to look a certain way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @brynhayder

      Issue actions

        Mutliclass Precision Recall Curve, docs not consistent with execution · Issue #203 · pytorch/torcheval