Skip to content
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

RFC make shape of arrays consistent #20634

Open
glemaitre opened this issue Jul 29, 2021 · 4 comments
Open

RFC make shape of arrays consistent #20634

glemaitre opened this issue Jul 29, 2021 · 4 comments
Labels

Comments

@glemaitre
Copy link
Member

Recently, we got some issues regarding the shape inconsistencies:

While it is pretty easy to make those arrays consistent across estimators, one could argue that the current user code is functioning.

This RFC is dedicated to know if we should solve this issue (see the failure in the different PRs) and if yes, shall we use a deprecation cycle to not break the code of our users from today to tomorrow?

@glemaitre
Copy link
Member Author

ping @scikit-learn/core-devs

@glemaitre glemaitre added the RFC label Jul 29, 2021
@NicolasHug
Copy link
Member

Regarding y_pred, I'm in favour of always retuning y_pred.shape == (n_samples,) instead of (n_samples, 1). Quoting my #20603 (comment):

One important thing to note is that if we start adopting the output_shape == input_shape convention, then we can't use the y_pred.ndim == 1 iff is_single_target assumption anymore. We currently rely on that assumption quite a bit I think, sometimes implicitly as is the case for the original failure in #19352.

I haven't looked at the details yet, but I would probably follow the same logic for coef_

@glemaitre
Copy link
Member Author

Regarding y_pred, I'm in favour of always retuning y_pred.shape == (n_samples,) instead of (n_samples, 1). Quoting my #20603 (comment):

Just to be complete, with a deprecation warning or with a breaking change @NicolasHug

@NicolasHug
Copy link
Member

A deprecation should be possible and users can silence the warning by just passing a 1-D array.

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

No branches or pull requests

2 participants