-
-
Notifications
You must be signed in to change notification settings - Fork 26k
removing extra tests, as they all raise the same error of min number of classes #15069
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
@raghavrv please check, i was working on machinelearnjs/machinelearnjs#243, found that these tests were written for wrong set of inputs, fixed that. |
…n number of classes
…n number of classes
Sorry, can you please clarify what you're fixing? |
@amueller I forgot the exact change but
we get error:
we get the same error
but if: we get error
which is the same error as said in comment so I think that should be the order of test cases. |
@amueller please review. |
I'm not really understanding what this is about either. Why do we need to
change the tests?
|
@@ -633,16 +633,17 @@ def test_stratified_shuffle_split_init(): | |||
assert_raises(ValueError, next, | |||
StratifiedShuffleSplit(3, 0.2).split(X, y)) | |||
|
|||
X = np.arange(9) | |||
y = np.asarray([0, 0, 0, 1, 1, 1, 2, 2, 2]) | |||
|
|||
# Check that error is raised if the test set size is smaller than n_classes |
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.
@jnothman the test written below wasn't testing what comment said.
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.
of course I might be wrong in my assumption, I am not sure anymore!
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.
To avoid confusion in the future, we can use
msg = "The test_size = 2 should be greater or equal to the number of classes = 3"
with pytest.raises(ValueError, match=msg):
next(StratifiedShuffleSplit(3, 2).split(X, y))
so we can check for the error message explicitly.
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.
will add these to the messages!
There is no longer |
Reference Issues/PRs
none
What does this implement/fix? Explain your changes.
removing extra tests, that raised the same errors
Any other comments?
This change is