A ColumnTransformer applies OneHotEncoder to two columns with remainder='passthrough'. What does the fitted output contain?
Correct answer
B. Encoded columns followed by every unlisted column appended unchanged in order
18 views
B. Encoded columns followed by every unlisted column appended unchanged in order
18 views
ColumnTransformer concatenates the output of each transformer horizontally, then appends columns not named in any transformer when remainder='passthrough'; the default 'drop' removes them. Column order is the transformers' order followed by the remainder, which is why get_feature_names_out should be used instead of assuming positions. Setting remainder to an estimator applies it to the leftover columns.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is B? Ask here and get an explanation.