FIX Allow sparse input data for OutputCodeClassifier#17233
Merged
glemaitre merged 3 commits intoscikit-learn:masterfrom May 26, 2020
zoj613:multiclass_bugfix
Merged
FIX Allow sparse input data for OutputCodeClassifier#17233glemaitre merged 3 commits intoscikit-learn:masterfrom zoj613:multiclass_bugfix
glemaitre merged 3 commits intoscikit-learn:masterfrom
zoj613:multiclass_bugfix
Conversation
zoj613
commented
May 15, 2020
glemaitre
reviewed
May 15, 2020
5 tasks
glemaitre
reviewed
May 19, 2020
Member
glemaitre
left a comment
There was a problem hiding this comment.
2 small changes (more for the style I should admit).
It remains a thing. Could you add an entry in doc/whats_new/0.24.rst in a section sklearn.multiclass and state this change as a |Fix|. You should credit yourself and this PR as well.
glemaitre
approved these changes
May 20, 2020
Member
glemaitre
left a comment
There was a problem hiding this comment.
LGTM. We will need a second review on this.
@rth @jeremiedbb @jnothman @thomasjpfan @NicolasHug @adrinjalali can you give a look at it.
NicolasHug
approved these changes
May 20, 2020
Member
NicolasHug
left a comment
There was a problem hiding this comment.
LGTM otherwise, thanks @zoj613
Member
|
I merge master where we add some changes that simplified the tests. If the tests pass I will merge it. |
glemaitre
approved these changes
May 26, 2020
Member
|
Thanks @zoj613 |
viclafargue
pushed a commit
to viclafargue/scikit-learn
that referenced
this pull request
Jun 26, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Fixes #17218
What does this implement/fix? Explain your changes.
This PR fixes a TypeError bug that occurs when fitting OutputCodeClassifier using sparse input data.
As suggested by @glemaitre I added the
allow_sparse=Truekeyword argument to_validate_dataandcheck_arrayfunctions inside the methodsfitandpredict. This allows the base estimator to handle the data check and throw the appropriate exception if sparse input is not allowed. I added a test case as well.