-
-
Notifications
You must be signed in to change notification settings - Fork 26k
FIX Ensure correct sklearn.metrics.coverage_error error message for 1D array #23548
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 Ensure correct sklearn.metrics.coverage_error error message for 1D array #23548
Conversation
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.
Thank you for the PR!
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.
Please add an entry to the change log at doc/whats_new/v1.2.rst
with tag |Fix|. Like the other entries there, please reference this pull request with :pr:
and credit yourself (and other contributors if applicable) with :user:
.
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.
LGTM
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.
LGTM. Thank you, @haochunchang.
Co-authored-by: Julien Jerphanion <[email protected]>
…D array (scikit-learn#23548) * Change input array to ensure_2d=True * Reshape input list to 2D if metric is coverage_error * Add test for error message with 1D array on coverage_error * Modify 1D error message test * Use parametrize to test different 1d arrays * Explain why reshape in test_regression_thresholded_inf_nan_input * Add changelog entry for this fix * Add test comments to sklearn/metrics/tests/test_ranking.py Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Julien Jerphanion <[email protected]>
…D array (scikit-learn#23548) * Change input array to ensure_2d=True * Reshape input list to 2D if metric is coverage_error * Add test for error message with 1D array on coverage_error * Modify 1D error message test * Use parametrize to test different 1d arrays * Explain why reshape in test_regression_thresholded_inf_nan_input * Add changelog entry for this fix * Add test comments to sklearn/metrics/tests/test_ranking.py Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Julien Jerphanion <[email protected]>
…D array (#23548) * Change input array to ensure_2d=True * Reshape input list to 2D if metric is coverage_error * Add test for error message with 1D array on coverage_error * Modify 1D error message test * Use parametrize to test different 1d arrays * Explain why reshape in test_regression_thresholded_inf_nan_input * Add changelog entry for this fix * Add test comments to sklearn/metrics/tests/test_ranking.py Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Julien Jerphanion <[email protected]>
Reference Issues/PRs
Fixes #23368
What does this implement/fix? Explain your changes.
check_array(., ensure_2d=False)
at the beginning of coverage_error toensure_2d=True
.test_regression_thresholded_inf_nan_input
in metrics common test to fix failed tests.Any other comments?
Not sure if adding the "if else" in the common test is elegant. It might adds more cognitive complexity. Hoping for any comment on it.