Skip to content

Commit d73e6c1

Browse files
New metric: LogAUC (#2377)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 8f6936d commit d73e6c1

File tree

14 files changed

+1394
-0
lines changed

14 files changed

+1394
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Added `NormalizedRootMeanSquaredError` metric to regression subpackage ([#2442](https://github.com/Lightning-AI/torchmetrics/pull/2442))
1616

1717

18+
- Added `LogAUC` metric to classification package ([#2377](https://github.com/Lightning-AI/torchmetrics/pull/2377))
19+
20+
1821
- Added `NegativePredictiveValue` to classification metrics ([#2433](https://github.com/Lightning-AI/torchmetrics/pull/2433))
1922

2023

docs/source/classification/logauc.rst

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.. customcarditem::
2+
:header: Log Area Receiver Operating Characteristic (LogAUC)
3+
:image: https://pl-flash-data.s3.amazonaws.com/assets/thumbnails/tabular_classification.svg
4+
:tags: Classification
5+
6+
.. include:: ../links.rst
7+
8+
#######
9+
Log AUC
10+
#######
11+
12+
Module Interface
13+
________________
14+
15+
.. autoclass:: torchmetrics.LogAUC
16+
:exclude-members: update, compute
17+
:special-members: __new__
18+
19+
BinaryLogAUC
20+
^^^^^^^^^^^^
21+
22+
.. autoclass:: torchmetrics.classification.BinaryLogAUC
23+
:exclude-members: update, compute
24+
25+
MulticlassLogAUC
26+
^^^^^^^^^^^^^^^^
27+
28+
.. autoclass:: torchmetrics.classification.MulticlassLogAUC
29+
:exclude-members: update, compute
30+
31+
MultilabelLogAUC
32+
^^^^^^^^^^^^^^^^
33+
34+
.. autoclass:: torchmetrics.classification.MultilabelLogAUC
35+
:exclude-members: update, compute
36+
37+
Functional Interface
38+
____________________
39+
40+
.. autofunction:: torchmetrics.functional.logauc
41+
42+
binary_logauc
43+
^^^^^^^^^^^^^
44+
45+
.. autofunction:: torchmetrics.functional.classification.binary_logauc
46+
47+
multiclass_logauc
48+
^^^^^^^^^^^^^^^^^
49+
50+
.. autofunction:: torchmetrics.functional.classification.multiclass_logauc
51+
52+
multilabel_logauc
53+
^^^^^^^^^^^^^^^^^
54+
55+
.. autofunction:: torchmetrics.functional.classification.multilabel_logauc

docs/source/links.rst

+1
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,5 @@
177177
.. _Hausdorff Distance: https://en.wikipedia.org/wiki/Hausdorff_distance
178178
.. _averaging curve objects: https://scikit-learn.org/stable/auto_examples/model_selection/plot_roc.html
179179
.. _Procrustes Disparity: https://en.wikipedia.org/wiki/Procrustes_analysis
180+
.. _Log AUC: https://pubmed.ncbi.nlm.nih.gov/20735049/
180181
.. _Negative Predictive Value: https://en.wikipedia.org/wiki/Positive_and_negative_predictive_values

requirements/classification_test.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ pandas >1.4.0, <=2.2.3
55
netcal >1.0.0, <1.4.0 # calibration_error
66
numpy <2.2.0
77
fairlearn # group_fairness
8+
PyTDC ==0.4.1 ; python_version <"3.12" # locauc, temporal_dependency

src/torchmetrics/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
HammingDistance,
6969
HingeLoss,
7070
JaccardIndex,
71+
LogAUC,
7172
MatthewsCorrCoef,
7273
NegativePredictiveValue,
7374
Precision,
@@ -196,6 +197,7 @@
196197
"JaccardIndex",
197198
"KLDivergence",
198199
"KendallRankCorrCoef",
200+
"LogAUC",
199201
"LogCoshError",
200202
"MatchErrorRate",
201203
"MatthewsCorrCoef",

src/torchmetrics/classification/__init__.py

+5
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
MulticlassJaccardIndex,
5858
MultilabelJaccardIndex,
5959
)
60+
from torchmetrics.classification.logauc import BinaryLogAUC, LogAUC, MulticlassLogAUC, MultilabelLogAUC
6061
from torchmetrics.classification.matthews_corrcoef import (
6162
BinaryMatthewsCorrCoef,
6263
MatthewsCorrCoef,
@@ -223,6 +224,10 @@
223224
"MulticlassSensitivityAtSpecificity",
224225
"MultilabelSensitivityAtSpecificity",
225226
"SensitivityAtSpecificity",
227+
"BinaryLogAUC",
228+
"LogAUC",
229+
"MulticlassLogAUC",
230+
"MultilabelLogAUC",
226231
"BinaryNegativePredictiveValue",
227232
"MulticlassNegativePredictiveValue",
228233
"MultilabelNegativePredictiveValue",

0 commit comments

Comments
 (0)