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+1] Adding multi output checks to common tests #13392
[MRG+1] Adding multi output checks to common tests #13392
Conversation
5328660
to
b720e06
Compare
33aa2ab
to
8618a0e
Compare
Thanks for the update !
I like much more your Mixin fix now.
You will also need to add en entry in https://github.com/scikit-learn/scikit-learn/blob/master/doc/whats_new/v0.21.rst#changes-to-estimator-checks, writing the change, this PR number and your GitHub name.
9450697
to
499fc5b
Compare
I wonder if requires_positive_data is implied by accepting pairwise data in
all cases.
|
But there's certainly nothing wrong with conditional tags
|
@jnothman - right, is there some other way to know? |
85cf3c0
to
c53179d
Compare
Ping! :) |
6a222f3
to
9a482b6
Compare
c9ceb6e
to
3f3671b
Compare
I've rebased and maybe we could get it merged in v0.22? :) |
14df99b
to
86e6baf
Compare
Rebased and fixed new issues. Since things changed it might be good to do another review. |
ok this has a chance to be merged soon and would make this much easier: #14884 |
@jnothman - will try to finish this tonight. Sorry for the delay :) |
0f23831
to
1969e70
Compare
I'm not sure if I got the general approach right but I have:
Please review :). Thanks for pushing this @glemaitre @jnothman @amueller! |
1969e70
to
fd6c04d
Compare
There is a couple of missing assert in the tests and I would add meaningful error message.
It would ease debugging when rolling your own estimator and that check_estimator is failing.
sklearn/utils/estimator_checks.py
Outdated
estimator.fit(X, y) | ||
y_pred = estimator.predict(X) | ||
|
||
assert y_pred.dtype == np.dtype('float') |
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.
Let's add an error message
"Multi-output predictions by a regressor are expected to be floating-point precision. Got {} instead".format(y_pred.dtype)
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.
We can also have a similar style as before
assert y_pred.dtype.kind == 'f'
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.
Had to set this to 'float64'
.
Thanks @glemaitre. I'll do this tonight. |
[MRG] Adding multi output checks to common tests (scikit-learn#13187) Removing redundant tests. Adding tests to check_classifier_multioutput and check_regressor_multioutput.
Co-Authored-By: Guillaume Lemaitre <g.lemaitre58@gmail.com>
c1457ad
to
8cef195
Compare
@glemaitre done, please review. :) |
bb8f4eb
to
78f3938
Compare
78f3938
to
8eabe3b
Compare
@glemaitre ping :) |
Thanks @rok |
Thanks all! :) |
Reference Issues/PRs
Fixes #13187.
Changes
This implements new classifier and regressor checks to test for multi-output support in common tests.
Some random forest and tree classifier test are removed as they are duplicating this functionality.