SimpleImputer Pipeline #27929
Unanswered
fernandovs4
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The imputer that you create is imputing the columns define in preprocessor = ColumnTransformer(
transformers=[
('onehot', make_pipeline(OneHotEncoder(), SimpleImputer()), categorical_cols),
('imputer', SimpleImputer(strategy='mean'), simple_inputer) ,
('scaler', make_pipeline(StandardScaler(), SimpleImputer()), standard_scaler)
# Preencha valores ausentes apenas nas colunas numéricas usando a estratégia da média
],
remainder='drop' # Mantenha as colunas não transformadas
) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, can I help me understand something related to SimpleImputer? I have code that uses a pipeline that has a SimpleImputer:
When I use my training and testing set it goes right:
but when I got a new line of data that has the NaN value in one column it says:
I don't understand why it gives this message. Shouldn't you fill the NaN with the media that the pipeline found in training?
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions