Sklearn OneHotEncoder not encoding correctly with Column Transformer #27830
AdventurousDataScientist
started this conversation in
General
Replies: 1 comment
-
The problem is not the Basically the first column is the output of the imputer and the subsequent columns are the output of the ct = make_column_transformer(
(
make_pipeline(categorical_imputer, OneHotEncoder(handle_unknown="ignore")),
["MSZoning"]
),
remainder="passthrough",
) I would advise to look at the following course to visually understand what the column transformer is doing (basically it does not pipeline transformer): https://inria.github.io/scikit-learn-mooc/python_scripts/03_categorical_pipeline_column_transformer.html And specifically this image: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on the House Price Prediction dataset and I am getting a strange error with One Hot Encoder, it keeps the original encoded variable, along with the encoded categorical variables. Here is the code I used
test.csv
train.csv
That is the image I get, the first column is 'RL', I thought that one hot encoder was supposed to get rid of the string column?
Could you please tell me what is going on?
Beta Was this translation helpful? Give feedback.
All reactions