MissingIndicator creates binary features that record whether values are missing. These indicators preserve information when absence itself may reveal how data was generated or predict an outcome. section 2.2.4 section 2.4.2
Treat missingness as a signal when:
- A relational join leaves unmatched records, making absence evidence of a missing database match. section 2.2.4
- A respondent skips a census question because the answer feels socially unacceptable, making nonresponse potentially informative. section 2.2.4
- A feature contains enough missing values that its missingness pattern could help prediction. section 2.4.2
Inspecting Auto MPG missingness
Before creating indicators, inspect missing counts with pandas isna(). In the Auto MPG data, mpg has 8 missing cases and horsepower has 6. MissingIndicator can preserve those patterns as binary features, while the model pipeline still applies an appropriate missing-value treatment when required. section 2.4.2
(data.isna()
.sum(axis=0)
)
Review the column-wise missing-value count used to identify features whose missingness may warrant indicator variables. section 2.4.2
