Shortcuts

Precision Recall Curve

Module Interface

torchmetrics.RetrievalPrecisionRecallCurve[source]

alias of _RetrievalPrecisionRecallCurve

Functional Interface

torchmetrics.functional.retrieval_precision_recall_curve(preds, target, max_k=None, adaptive_k=False)[source]

Wrapper for deprecated import.

>>> from torch import tensor
>>> preds = tensor([0.2, 0.3, 0.5])
>>> target = tensor([True, False, True])
>>> precisions, recalls, top_k = _retrieval_precision_recall_curve(preds, target, max_k=2)
>>> precisions
tensor([1.0000, 0.5000])
>>> recalls
tensor([0.5000, 0.5000])
:rtype: :py:data:`~typing.Tuple`\[:py:class:`~torch.Tensor`, :py:class:`~torch.Tensor`, :py:class:`~torch.Tensor`]
>>> top_k
tensor([1, 2])