Improve error message for sparse multilabel-indicator y in RandomForestClassifier#15971
Improve error message for sparse multilabel-indicator y in RandomForestClassifier#15971jnothman merged 10 commits intoscikit-learn:masterfrom
Conversation
rth
left a comment
There was a problem hiding this comment.
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 .