Skip to content

[MRG+1] Don't use deprecated Imputer in bagging tests#11593

Merged
glemaitre merged 1 commit intoscikit-learn:masterfrom
amueller:simpleimputer_bagging
Jul 17, 2018
Merged

[MRG+1] Don't use deprecated Imputer in bagging tests#11593
glemaitre merged 1 commit intoscikit-learn:masterfrom
amueller:simpleimputer_bagging

Conversation

@amueller
Copy link
Copy Markdown
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
Copy Markdown
Member Author

fixes #11482

@agramfort
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

@amueller
Copy link
Copy Markdown
Member Author

@qinhanmin2014 which regression / where?

@qinhanmin2014
Copy link
Copy Markdown
Member

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

@amueller
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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


def replace(X):
X = X.copy().astype('float')
Copy link
Copy Markdown
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
Copy Markdown
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