-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
MRG allow (n_samples, 1) input for all classifiers #2251
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
MRG allow (n_samples, 1) input for all classifiers #2251
Conversation
ping @GaelVaroquaux ;) |
travis is not happy |
The naive Bayes tests are failing: apparently this patch is making them return floats from |
@@ -227,6 +231,18 @@ def check_arrays(*arrays, **options): | ||
return checked_arrays | ||
|
||
|
||
def make_y_1d(y): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have a look at _column_or_1d in the metrics module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, I forgot about that :-/ why is it in the metrics module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it has only been used in this module and was a private function.
For the metrics, it ensure consistent behaviour with respect to broadcasting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll move it into utils and rename the trailing underscore, ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK ! :-) by the way the name was finally found by @jnothman and approved by @GaelVaroquaux and me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure now I actually reviewed it. But somehow it slipped my mind ;)
travis is happy now |
@larsmans I went a bit overboard when I tried to improve the input validation in the NB, which was only slightly related ;) |
I'm still a bit ambivalent about how useful this is. But I guess it improves the symmetry and the code looks good. |
the alternative would be to replace the call to |
Actually putting in that error message is very tempting. But the exception type should be PEBKAC. |
Funny PEBKAC ! :-) |
@larsmans but would you also put that into |
Just to let you know if you haven't noticed, knn now support multi-output data |
it does? oh, I thought it wasn't merged yet. whoops. was it merged at the sprint? |
yes :-) |
Look good to merge |
oh ok. but it did support the input format before this afternoon ;) |
damn misclicks :-/ |
@amueller No, you're right. +1 for merge. |
ok, will merge. |
Fixes issue #604, makes all estimators behave in a uniform and predictable way.