A column in the training data is entirely NaN. What does SimpleImputer(strategy='mean') do with it by default?
Correct answer
D. It drops the column from the transformed output and ignores it during transform
20 views
D. It drops the column from the transformed output and ignores it during transform
20 views
SimpleImputer discards features that contain only missing values when keep_empty_features is False, the default, so the output has fewer columns than the input. This silently shifts column positions, which is why inspecting get_feature_names_out or the ColumnTransformer mapping matters. Setting keep_empty_features=True retains the column filled with the fill value.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is D? Ask here and get an explanation.