-
-
Notifications
You must be signed in to change notification settings - Fork 26k
Improve error message for sparse multilabel-indicator y in RandomForestClassifier #15971
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
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.
Thanks for the PR.
Can somebody please guide me to get rid of these failing codecov checks?
You need to add a unit tests that passes a sparse y and checks that the correct error message is raised with,
msg = "multilabel-indicator of type sparse is not supported"
with pytest.raises(ValueError, match=msg):
est.fit(X, y)
I have changed the location of the condition because the call |
Can we change value of the argement |
Sorry, you're right, this should be improved....
That seems like the right thing to do.... Why do we say that we accept sparse y there? DecisionTreeClassifier checks y and does not accept sparse.... |
Looks like The forest was not updated to reflect this change. |
Then is this PR going to be merged or it should be closed now? |
This PR is nice to have since it specifies For the regular tree code, we do not do this explicit check and use the default |
Oh, okay. |
Can you merge this, please? @NicolasHug |
Thanks @rushabh-v |
Fixes #15958 .