ENH keep features with all missing values during imputation#24770
ENH keep features with all missing values during imputation#24770jjerphan merged 23 commits intoscikit-learn:mainfrom
Conversation
…uter._initial_imputation
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
jeremiedbb
left a comment
There was a problem hiding this comment.
Here's a first pass. As discussed, we probably don't want to let the features with all missing get out of transform unchanged, i.e still with nans. It's a surprising behavior for an imputer. As a first simple solution we can impute them by 0 (the value should never be relevant anyway). I was wondering if for the SimpleImputer with strategy=constant we would like to impute with "fill_value", otherwise the behavior might be confusing ?
|
I will first add the support for imputing with a constant now that I merge |
jjerphan
left a comment
There was a problem hiding this comment.
Thank you for pursuing this work, @glemaitre!
Here are a few comments.
|
So it appears that your changes eventually ended up showing in the original PR. I guess github was having a hard time :) |
I will continue here and make sure that we use the original entry in the changelog and acknowledge the contributor. |
|
Adding the label "No change needed" to not have an error raised due to the PR number mismatch. |
|
@jeremiedbb @jjerphan This PR is now ready to be reviewed. I added some additional documentation. |
|
Uhm the bad bug :). We have a list where the tests modify a global variable. |
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
jjerphan
left a comment
There was a problem hiding this comment.
LGTM. Thank you, @vitorsrg for initiating this work and @glemaitre for superseding it.
jeremiedbb
left a comment
There was a problem hiding this comment.
LGTM. Just a few typos and nitpicks
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Fixes #16695
Fixes #16426
Fixes #16977
Pushing in the contributor branch did not seem to sync with GitHub.
Opening this PR the.