Rename class metrics PrecisionRecall to PrecisionRecallCurve and update examples
🚀 Feature
Rename the class metric PrecisionRecall to PrecisionRecallCurve
Motivation
the class metric PrecisionRecall is based on the functional metric precision_recall_curve and therefore should have PrecisionRecallCurve as its proper name instead of the current name PrecisionRecall.
In addition, there is need to update examples both for the functional and class metrics as in this case pred is a probability and the original example is misleading:
>>> pred = torch.tensor([0, 1, 2, 3])
>>> target = torch.tensor([0, 1, 2, 2])
>>> metric = PrecisionRecall()
>>> prec, recall, thr = metric(pred, target)
>>> prec
tensor([0.3333, 0.0000, 0.0000, 1.0000])
>>> recall
tensor([1., 0., 0., 0.])
>>> thr
tensor([1., 2., 3.])

The below is proposed example for the functional metric:
        >>> pred = torch.tensor([0.1, 0.4, 0.35, 0.8])
        >>> target = torch.tensor([0, 0, 1, 1])
        >>> precision, recall, thresholds = precision_recall_curve(pred, target)
        >>> precision
        tensor([0.6667, 0.5000, 1.0000, 1.0000])
        >>> recall
        tensor([1.0000, 0.5000, 0.5000, 0.0000])
        >>> thresholds
        tensor([0.3500, 0.4000, 0.8000])

The below is proposed example for the class metric:
        >>> pred = torch.tensor([0.1, 0.4, 0.35, 0.8])
        >>> target = torch.tensor([0, 0, 1, 1])
        >>> metric = PrecisionRecallCurve()
        >>> prec, recall, thr = metric(pred, target)
        >>> prec
        tensor([0.6667, 0.5000, 1.0000, 1.0000])
        >>> recall
        tensor([1.0000, 0.5000, 0.5000, 0.0000])
        >>> thr
        tensor([0.3500, 0.4000, 0.8000])

Pitch
Please see above
Alternatives
Additional context