[RFC] deprecate 1d X in check_array [was reshape sensibly]#4511
[RFC] deprecate 1d X in check_array [was reshape sensibly]#4511amueller wants to merge 10 commits intoscikit-learn:masterfrom
Conversation
|
you have my +1 on this. We "just" need to fix all the estimators that complain... |
|
I'm on it ;) |
|
Most of the remaining fun seems to be estimators that just in general don't handle 1d data.... great! |
|
This will probably break a lot of code, seeing how it broke so many tests. I see the following possible choices:
|
|
|
|
Feedback from @GaelVaroquaux @ogrisel @jnothman would be very welcome. I'll probably go ahead and "fix" this anyhow, but the deprecations probably need somewhat different work. |
|
+1 on making |
|
@ogrisel and deprecate the current behavior? on master, all |
|
FYI, in 0.15, most estimators "worked" but some broke on these methods when given |
Indeed I had not realized. I am not so sure anymore. |
|
Checking the current It is a bit hard to say, though, as many estimators crash when given a single sample. |
|
I think for Or alternatively we could raise a For I wonder what other people think. |
|
ask on the ml? |
|
After the discussion on the ML, I think we deprecate and "raise"? |
|
I think the proposed solution is the right one since it is the only one consistent with the label transformers interface. For example, My 2 cents. |
|
@dukebody well the label transformers are on |
|
Replaced by #5152 which got merged. |
reshape in
check_arrayfor ndim==1 using reshape(-1, 1), not reshape(1, -1).See #4509 #4466. [edit] Not sure this is the right idea any more[/edit].
On master, all "transform", "decision_function" and "predict_proba" take X of shape
(n_features,)without issue. Investigating whether I brought this upon us with
check_array.Sadness so far:
(1, n_features)).