Skip to content

Commit f1386c4

Browse files
committed
Add PRGAIN enum for AUC metric types
1 parent 8ff95a0 commit f1386c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

keras/src/metrics/metrics_utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,20 @@ class AUCCurve(Enum):
4343

4444
ROC = "ROC"
4545
PR = "PR"
46+
PRGAIN = "PRGAIN"
4647

4748
@staticmethod
4849
def from_str(key):
4950
if key in ("pr", "PR"):
5051
return AUCCurve.PR
5152
elif key in ("roc", "ROC"):
5253
return AUCCurve.ROC
54+
elif key in ("prgain", "PRGAIN"):
55+
return AUCCurve.PRGAIN
5356
else:
5457
raise ValueError(
5558
f'Invalid AUC curve value: "{key}". '
56-
'Expected values are ["PR", "ROC"]'
59+
'Expected values are ["PR", "ROC", "PRGAIN"]'
5760
)
5861

5962

0 commit comments

Comments
 (0)