Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newmetric: Negative predictive value #2433

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added multi-output support for MAE metric ([#2605](https://github.com/Lightning-AI/torchmetrics/pull/2605))


- Added `NegativePredictiveValue` to classification metrics ([#2433](https://github.com/Lightning-AI/torchmetrics/pull/2433))


### Changed

-
Expand Down
56 changes: 56 additions & 0 deletions docs/source/classification/negative_predictive_value.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. customcarditem::
:header: Negative Predictive Value
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg
:tags: Classification

.. include:: ../links.rst

#########################
Negative Predictive Value
#########################

Module Interface
________________

.. autoclass:: torchmetrics.NegativePredictiveValue
:exclude-members: update, compute
:special-members: __new__

BinaryNegativePredictiveValue
^^^^^^^^^^^^^^^^^

.. autoclass:: torchmetrics.classification.BinaryNegativePredictiveValue
:exclude-members: update, compute

MulticlassNegativePredictiveValue
^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: torchmetrics.classification.MulticlassNegativePredictiveValue
:exclude-members: update, compute

MultilabelNegativePredictiveValue
^^^^^^^^^^^^^^^^^^^^^

.. autoclass:: torchmetrics.classification.MultilabelNegativePredictiveValue
:exclude-members: update, compute


Functional Interface
____________________

.. autofunction:: torchmetrics.functional.negative_predictive_value

binary_negative_predictive_value
^^^^^^^^^^^^^^^^^^

.. autofunction:: torchmetrics.functional.classification.binary_negative_predictive_value

multiclass_negative_predictive_value
^^^^^^^^^^^^^^^^^^^^^^

.. autofunction:: torchmetrics.functional.classification.multiclass_negative_predictive_value

multilabel_negative_predictive_value
^^^^^^^^^^^^^^^^^^^^^^

.. autofunction:: torchmetrics.functional.classification.multilabel_negative_predictive_value
2 changes: 2 additions & 0 deletions src/torchmetrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
HingeLoss,
JaccardIndex,
MatthewsCorrCoef,
NegativePredictiveValue,
Precision,
PrecisionAtFixedRecall,
PrecisionRecallCurve,
Expand Down Expand Up @@ -201,6 +202,7 @@
"MultioutputWrapper",
"MultitaskWrapper",
"MultiScaleStructuralSimilarityIndexMeasure",
"NegativePredictiveValue",
"PanopticQuality",
"PearsonCorrCoef",
"PearsonsContingencyCoefficient",
Expand Down
10 changes: 10 additions & 0 deletions src/torchmetrics/classification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
MulticlassMatthewsCorrCoef,
MultilabelMatthewsCorrCoef,
)
from torchmetrics.classification.negative_predictive_value import (
BinaryNegativePredictiveValue,
MulticlassNegativePredictiveValue,
MultilabelNegativePredictiveValue,
NegativePredictiveValue,
)
from torchmetrics.classification.precision_fixed_recall import (
BinaryPrecisionAtFixedRecall,
MulticlassPrecisionAtFixedRecall,
Expand Down Expand Up @@ -217,4 +223,8 @@
"MulticlassSensitivityAtSpecificity",
"MultilabelSensitivityAtSpecificity",
"SensitivityAtSpecificity",
"BinaryNegativePredictiveValue",
"MulticlassNegativePredictiveValue",
"MultilabelNegativePredictiveValue",
"NegativePredictiveValue",
]
Loading
Loading