-
-
Notifications
You must be signed in to change notification settings - Fork 692
Sweep: Docs test issue with roc_auc #2987
Description
Docs test issue with roc_auc, probably related to the new scikit-learn release:
File "../../ignite/contrib/metrics/roc_auc.py", line ?, in default
Failed example:
roc_auc = RocCurve()
#The output_transform arg of the metric can be used to perform a sigmoid on the y_pred.
roc_auc.attach(default_evaluator, 'roc_auc')
y_pred = torch.tensor([0.0474, 0.5987, 0.7109, 0.9997])
y_true = torch.tensor([0, 0, 1, 0])
state = default_evaluator.run([[y_pred, y_true]])
print("FPR", [round(i, 3) for i in state.metrics['roc_auc'][0].tolist()])
print("TPR", [round(i, 3) for i in state.metrics['roc_auc'][1].tolist()])
print("Thresholds", [round(i, 3) for i in state.metrics['roc_auc'][2].tolist()])
Expected:
FPR [0.0, 0.333, 0.333, 1.0]
TPR [0.0, 0.0, 1.0, 1.0]
Thresholds [2.0, 1.0, 0.711, 0.047]
Got:
FPR [0.0, 0.333, 0.333, 1.0]
TPR [0.0, 0.0, 1.0, 1.0]
Thresholds [inf, 1.0, 0.711, 0.047]
5 items passed all tests:
1 tests in 1
1 tests in 2
1 tests in 3
1 tests in 4
1 tests in 5
1 items had failures:
1 of 2 in default
7 tests in 6 items.
6 passed and 1 failed.
Test Failed 1 failures.