Skip to content

ClassifierChain should only accept multilabel-indicator #19853

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

Open
glemaitre opened this issue Apr 9, 2021 · 4 comments
Open

ClassifierChain should only accept multilabel-indicator #19853

glemaitre opened this issue Apr 9, 2021 · 4 comments

Comments

@glemaitre
Copy link
Member

By trying to solve #19357 and writing some test, it seems that ClassifierChain is expected to be fitted with multilabel-indicator target (each column should only contain 0/1 classes).

However, there is no check and one can fit a multiclass-multioutput target. The classifier will later fail if calling decision_function that would return an array of shape n_samples, 3 while an array of n_samples, is expected. I assume a similar behaviour for predict_proba.

I think that we should check the type of target to raise a proper error at fit.

@jnothman
Copy link
Member

Duplicate of #13339?

@jnothman
Copy link
Member

jnothman commented Apr 10, 2021

Alternatively, #14654 could be completed to support multioutput-multiclass. It's waiting for review

@glemaitre
Copy link
Member Author

Thanks @jnothman I did not recall #14654. In case that we want to have support for multiclass-multioutput, what shape of y_pred do we expect?

@glemaitre
Copy link
Member Author

I was looking at the original paper: https://www.cs.waikato.ac.nz/~ml/publications/2009/chains.pdf since that I am not really familiar with chains.

I have the impression that supporting multiclass-multioutput will solve a really different problem than multilabel-indicator.
By adding into the feature space, a column of y, you create an interaction. Thus, in multiclass-multioutput, the interaction created is between outputs, while in multilabel, this is between classes, isn't it?

If this is the case, we should rewrite the documentation to explain the difference in modelling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants