Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

amueller
Copy link
Member

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.

@amueller amueller added this to the 0.20 milestone Jul 17, 2018
@amueller
Copy link
Member Author

fixes #11482

@agramfort
Copy link
Member

@amueller merge when CIs are green.

@GaelVaroquaux GaelVaroquaux changed the title [MRG] Don't use deprecated Imputer in bagging tests [MRG+1] Don't use deprecated Imputer in bagging tests Jul 17, 2018
Copy link
Member

@GaelVaroquaux GaelVaroquaux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks

@qinhanmin2014
Copy link
Member

maybe also note the regression? I'm fine with current version though.

@amueller
Copy link
Member Author

@qinhanmin2014 which regression / where?

@qinhanmin2014
Copy link
Member

Not sure but you might refer to e.g.,
#11482 (comment)

@amueller
Copy link
Member Author

@qinhanmin2014 The test is unrelated to imputation so adding anything about changes in the imputation api here seems pretty cryptic / out of place.

@qinhanmin2014
Copy link
Member

My point is that to close #11482 , it might be better to note down situations we no longer support.
Falling asleep so don't let my opinion block your work. I'm also fine with current PR :)

@glemaitre
Copy link
Member

My point is that to close #11482 , it might be better to note down situations we no longer support.
Falling asleep so don't let my opinion block your work. I'm also fine with current PR :)

SimpeImputer is a new class so I would not bother. And supporting imputation with np.inf seems wrong.

@glemaitre glemaitre merged commit b577fb9 into scikit-learn:master Jul 17, 2018
@@ -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')
Copy link
Contributor

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.

Copy link
Member Author

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.

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

Successfully merging this pull request may close these issues.

6 participants