-
-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(areaScores): consistency b/w aupr auroc #26176
base: main
Are you sure you want to change the base?
fix(areaScores): consistency b/w aupr auroc #26176
Conversation
Hi! You need to update tests so that it will expect warning and not value error |
@a-parida12 would you still like to work on this PR? |
@lucyleeow could you please help me out, by pointing to me what needs to be done to be able to merge it? I updated the changes from the main to the current branch. |
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
As suggested above, the tests need to pass, |
@lucyleeow thanks for pointing it out to me... I will get working on it. |
@lucyleeow @glevv this pull request is ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add a UndefinedMetricWarning
type here instead of UserWarning
@glevv cool I will update the |
Will need a reviewer on this one |
with pytest.raises(ValueError): | ||
metric(y1_row, y2_row) | ||
if "roc_auc" not in name: | ||
with pytest.raises(ValueError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity, which metrics currently hit this branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following:
- adjusted_balanced_accuracy_score
- balanced_accuracy_score
- cohen_kappa_score
- d2_tweedie_score
- hinge_loss
- matthews_corrcoef_score
- max_error
- mean_compound_poisson_deviance
- mean_gamma_deviance
- mean_normal_deviance
- mean_poisson_deviance
- normalized_confusion_matrix
- ovo_roc_auc
- ovr_roc_auc
- top_k_accuracy_score
- unnormalized_confusion_matrix
- weighted_ovo_roc_auc
- weighted_ovr_roc_auc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to sanity check then, do we want to propogate the preference for a warning over an error to any of these as well?
I would prefer to have to separate pull-request:
Indeed, we will need two different entries in the changelog |
@@ -363,7 +363,10 @@ def test_roc_curve_toydata(): | |||
with pytest.warns(UndefinedMetricWarning, match=expected_message): | |||
tpr, fpr, _ = roc_curve(y_true, y_score) | |||
|
|||
with pytest.raises(ValueError): | |||
expected_message = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to update the message and type of warning.
with pytest.raises(ValueError): | ||
metric(y1_row, y2_row) | ||
if "roc_auc" not in name: | ||
with pytest.raises(ValueError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following:
- adjusted_balanced_accuracy_score
- balanced_accuracy_score
- cohen_kappa_score
- d2_tweedie_score
- hinge_loss
- matthews_corrcoef_score
- max_error
- mean_compound_poisson_deviance
- mean_gamma_deviance
- mean_normal_deviance
- mean_poisson_deviance
- normalized_confusion_matrix
- ovo_roc_auc
- ovr_roc_auc
- top_k_accuracy_score
- unnormalized_confusion_matrix
- weighted_ovo_roc_auc
- weighted_ovr_roc_auc
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
The CIs are failing. |
Reference Issues/PRs
Fixes #24381
What does this implement/fix? Explain your changes.
ValueError
withUserwarning