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

Merged
merged 26 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e30ad48
update init files
SkafteNicki Mar 6, 2024
16fd133
base implementations
SkafteNicki Mar 6, 2024
cf5841a
tests
SkafteNicki Mar 6, 2024
5e78997
docs
SkafteNicki Mar 6, 2024
0dd5205
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 6, 2024
627a66b
changelog
SkafteNicki Mar 6, 2024
57a7003
Merge branch 'newmetric/negative_predictive_value' of https://github.…
SkafteNicki Mar 6, 2024
e213a88
Merge branch 'master' into newmetric/negative_predictive_value
Borda Mar 28, 2024
32e35d1
Merge branch 'master' into newmetric/negative_predictive_value
Borda Apr 10, 2024
e1a6885
Merge branch 'master' into newmetric/negative_predictive_value
Borda Jun 12, 2024
b7c8131
Merge branch 'master' into newmetric/negative_predictive_value
Borda Jul 22, 2024
ce75bb3
Merge branch 'master' into newmetric/negative_predictive_value
Borda Aug 5, 2024
1297378
Merge branch 'master' into newmetric/negative_predictive_value
SkafteNicki Oct 24, 2024
0e1a6ec
add link
SkafteNicki Oct 24, 2024
5981c02
fix functional implementation
SkafteNicki Oct 24, 2024
9ecf002
fix modular implementation
SkafteNicki Oct 24, 2024
21fb505
fix tests
SkafteNicki Oct 25, 2024
38dcdc6
fix docs
SkafteNicki Oct 25, 2024
48a503b
Apply suggestions from code review
Borda Oct 29, 2024
cd9dbb5
fix pre-commit
SkafteNicki Oct 29, 2024
a43af1c
Merge branch 'master' into newmetric/negative_predictive_value
SkafteNicki Oct 29, 2024
1ce547a
Merge branch 'master' into newmetric/negative_predictive_value
Borda Oct 29, 2024
1240c0e
Merge branch 'master' into newmetric/negative_predictive_value
mergify[bot] Oct 30, 2024
bbd1d13
Merge branch 'master' into newmetric/negative_predictive_value
Borda Oct 30, 2024
dc2aa11
Apply suggestions from code review
Borda Oct 30, 2024
eda9e87
Merge branch 'master' into newmetric/negative_predictive_value
Borda Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `NormalizedRootMeanSquaredError` metric to regression subpackage ([#2442](https://github.com/Lightning-AI/torchmetrics/pull/2442))


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


### Changed

- Changed naming and input order arguments in `KLDivergence` ([#2800](https://github.com/Lightning-AI/torchmetrics/pull/2800))
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
1 change: 1 addition & 0 deletions docs/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@
.. _Hausdorff Distance: https://en.wikipedia.org/wiki/Hausdorff_distance
.. _averaging curve objects: https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html
.. _Procrustes Disparity: https://en.wikipedia.org/wiki/Procrustes_analysis
.. _Negative Predictive Value: https://en.wikipedia.org/wiki/Positive_and_negative_predictive_values
2 changes: 2 additions & 0 deletions src/torchmetrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
HingeLoss,
JaccardIndex,
MatthewsCorrCoef,
NegativePredictiveValue,
Precision,
PrecisionAtFixedRecall,
PrecisionRecallCurve,
Expand Down Expand Up @@ -207,6 +208,7 @@
"MultiScaleStructuralSimilarityIndexMeasure",
"MultioutputWrapper",
"MultitaskWrapper",
"NegativePredictiveValue",
"NormalizedRootMeanSquaredError",
"PanopticQuality",
"PeakSignalNoiseRatio",
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