scikit-learn / scikit-learn

scikit-learn: machine learning in Python
https://scikit-learn.org
BSD 3-Clause "New" or "Revised" License
58.85k stars 25.13k forks source link

adding multilabel capability to voting classifier and bagging classifier #14648

Open cgcodeboy opened 4 years ago

cgcodeboy commented 4 years ago

Description

There is so many classifiers that can not use multilabel, but why voting classifier and bagging classifier can not use multilabel? the base classifier in the voting and bagging classifer already support multilabel.

jnothman commented 4 years ago

There may be no good reason except that they haven't been implemented yet.

oneraghavan commented 4 years ago

I would like to pick this up. Need some pointers .

jnothman commented 4 years ago

Have a look at other estimators where multioutput classification is supported. Understand the shape of the input and output and look at the tests for multioutput support on those classifiers. Add a test corresponding to similar functionality in test_voting.py (that checks multioutput data can be fitted and can be predicted with the correct shape). That test should fail. You can then open a WIP pull request, or continue on to implementing a fix. Thanks!

adam2392 commented 4 weeks ago

@jnothman Is this still desirable? If so, I'm happy to look into how to add this feature.

adrinjalali commented 3 weeks ago

@adam2392 I think this can still be fixed. Would be nice if you could have a look.

adam2392 commented 2 weeks ago

I have a working draft in https://github.com/scikit-learn/scikit-learn/pull/29238 on extending multilabel-indicator support for VotingClassifier in case it is of interest for people to review.

There's some code I can clean up, but the unit-tests should demonstrate the new feature