In a lending dataset, employment_length is missing for 6% of applicants. An analyst notices that applicants with missing values default at 31%, versus 12% overall.
What is the best way to handle this column in a pipeline?
Why did you pick that answer? Two or three sentences. The act of articulating it is what builds the judgment — not the click that follows.
The missingness is itself informative (31% vs 12% default) — it is Missing Not At Random. Imputing keeps the row usable for every model; the indicator preserves the signal that the value was blank. scikit-learn's SimpleImputer(add_indicator=True) does both in one step, inside the pipeline so it is fit on training data only.
Dropping those rows deletes the applicants most likely to default — the exact cases a lender needs to learn from — and the model will never see a blank at scoring time even though production data will have them.
A 19-point gap in default rate is one of the strongest signals in the dataset. Discarding it is throwing away information.
Almost every real business column has gaps. The job is to handle them, not to abandon the feature.