Skip to content

Commit

Permalink
New metric: LogAUC (#2377)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
SkafteNicki and pre-commit-ci[bot] authored Nov 12, 2024
1 parent 8f6936d commit d73e6c1
Show file tree
Hide file tree
Showing 14 changed files with 1,394 additions and 0 deletions.
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 `LogAUC` metric to classification package ([#2377](https://github.com/Lightning-AI/torchmetrics/pull/2377))


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


Expand Down
55 changes: 55 additions & 0 deletions docs/source/classification/logauc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.. customcarditem::
:header: Log Area Receiver Operating Characteristic (LogAUC)
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg
:tags: Classification

.. include:: ../links.rst

#######
Log AUC
#######

Module Interface
________________

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

BinaryLogAUC
^^^^^^^^^^^^

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

MulticlassLogAUC
^^^^^^^^^^^^^^^^

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

MultilabelLogAUC
^^^^^^^^^^^^^^^^

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

Functional Interface
____________________

.. autofunction:: torchmetrics.functional.logauc

binary_logauc
^^^^^^^^^^^^^

.. autofunction:: torchmetrics.functional.classification.binary_logauc

multiclass_logauc
^^^^^^^^^^^^^^^^^

.. autofunction:: torchmetrics.functional.classification.multiclass_logauc

multilabel_logauc
^^^^^^^^^^^^^^^^^

.. autofunction:: torchmetrics.functional.classification.multilabel_logauc
1 change: 1 addition & 0 deletions docs/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,5 @@
.. _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
.. _Log AUC: https://pubmed.ncbi.nlm.nih.gov/20735049/
.. _Negative Predictive Value: https://en.wikipedia.org/wiki/Positive_and_negative_predictive_values
1 change: 1 addition & 0 deletions requirements/classification_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pandas >1.4.0, <=2.2.3
netcal >1.0.0, <1.4.0 # calibration_error
numpy <2.2.0
fairlearn # group_fairness
PyTDC ==0.4.1 ; python_version <"3.12" # locauc, temporal_dependency
2 changes: 2 additions & 0 deletions src/torchmetrics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
HammingDistance,
HingeLoss,
JaccardIndex,
LogAUC,
MatthewsCorrCoef,
NegativePredictiveValue,
Precision,
Expand Down Expand Up @@ -196,6 +197,7 @@
"JaccardIndex",
"KLDivergence",
"KendallRankCorrCoef",
"LogAUC",
"LogCoshError",
"MatchErrorRate",
"MatthewsCorrCoef",
Expand Down
5 changes: 5 additions & 0 deletions src/torchmetrics/classification/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
MulticlassJaccardIndex,
MultilabelJaccardIndex,
)
from torchmetrics.classification.logauc import BinaryLogAUC, LogAUC, MulticlassLogAUC, MultilabelLogAUC
from torchmetrics.classification.matthews_corrcoef import (
BinaryMatthewsCorrCoef,
MatthewsCorrCoef,
Expand Down Expand Up @@ -223,6 +224,10 @@
"MulticlassSensitivityAtSpecificity",
"MultilabelSensitivityAtSpecificity",
"SensitivityAtSpecificity",
"BinaryLogAUC",
"LogAUC",
"MulticlassLogAUC",
"MultilabelLogAUC",
"BinaryNegativePredictiveValue",
"MulticlassNegativePredictiveValue",
"MultilabelNegativePredictiveValue",
Expand Down
Loading

0 comments on commit d73e6c1

Please sign in to comment.