-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG+1] Don't use deprecated Imputer in bagging tests #11593
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
Conversation
fixes #11482 |
@amueller merge when CIs are green. |
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.
LGTM. Thanks
maybe also note the regression? I'm fine with current version though. |
@qinhanmin2014 which regression / where? |
Not sure but you might refer to e.g., |
@qinhanmin2014 The test is unrelated to imputation so adding anything about changes in the imputation api here seems pretty cryptic / out of place. |
My point is that to close #11482 , it might be better to note down situations we no longer support. |
SimpeImputer is a new class so I would not bother. And supporting imputation with np.inf seems wrong. |
@@ -755,6 +755,12 @@ def test_set_oob_score_label_encoding(): | |||
assert_equal([x1, x2], [x3, x3]) | |||
|
|||
|
|||
def replace(X): | |||
X = X.copy().astype('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.
Sorry to necro this, but astype
copies by default. Should there still be a copy
call here? Admittedly I know nothing about this code. So feel free to correct me if I'm missing something.
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're right. This is a hack used in a test, though, so I don't think it matters. We could remove the copy()
though.
Should be in the spirit of the test. I don't think passing inf as missing values makes sense and SimpleImputer doesn't support it.