-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[MRG] Remove some warnings from test suit #5283
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
Conversation
sorted_array = np.arange(201, 300) | ||
assert_true(np.any(sorted_array != ind[train])) | ||
assert_true(np.any(np.arange(100) != ind[test])) | ||
assert_true(np.any(np.arange(100, 200) != ind[test])) |
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.
why changing 101 to 100?
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.
np.arange(100) = [0, ..., 99] (100 elements)
np.arange(100, 200) = [100, ..., 199] (100 elements)
np.arange(101, 200) = [101, ..., 199] (99 elements)
The test was asserting the arrays are different because of different sizes, and not because of the shuffling (as expected).
besides LGTM |
@@ -323,6 +322,7 @@ def test_cohen_kappa(): | |||
assert_almost_equal(cohen_kappa_score(y1, y2), .8013, decimal=4) | |||
|
|||
|
|||
@ignore_warnings |
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.
What is the issue being raised here? Is ignoring the warning the only way?
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.
RuntimeWarning: Degrees of freedom <= 0 for slice
np.corrcoef raises a warning when dividing by zero, and return a NaN.
This test verifies that matthews_corrcoef
transforms the NaN in zeros, so we can silence the warning
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.
Ah, excellent.
Other than my comments, this LGTM. I don't think the best solution to warnings is just squelching them if they can be fixed, because in the future we can't see which warnings have to be fixed. |
I fixed the warnings without using |
With my comments addressed, this LGTM. |
Thanks for the review ! |
[MRG] Remove some warnings from test suit
thanks @TomDLT ! |
I removed some warnings from the test suit.
Issue #5089
Complementary work #5277