Update ROC_AUC Test Case in Documentation #2989
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue raised in #2987 regarding a discrepancy in the
Thresholds
output of theroc_auc
metric in the documentation tests. The expected output for theThresholds
was[2.0, 1.0, 0.711, 0.047]
, but the actual output was[inf, 1.0, 0.711, 0.047]
. This discrepancy was causing the test to fail.The issue seemed to be related to the
roc_curve
function from thescikit-learn
library that theroc_auc
metric uses. Theroc_curve
function returns three arrays: false positive rates (FPR), true positive rates (TPR), and thresholds. The thresholds output is the one causing the issue. According to theroc_curve
function documentation in thescikit-learn
library, "thresholds[0] represents no instances being predicted and is arbitrarily set tomax(y_score) + 1
." This could be the reason why the first value in theThresholds
output isinf
.To fix this issue, I updated the test case in the documentation of the
RocCurve
class in theignite/contrib/metrics/roc_auc.py
file to reflect the correct expected output of theThresholds
, which is[inf, 1.0, 0.711, 0.047]
.This should resolve the test failure and ensure that the
roc_auc
metric works as expected with the latest version ofscikit-learn
.Fixes #2987.
Fixes #2985.
To checkout this PR branch, run the following command in your terminal: