Choosing the right strategy
| Situation | Suggested approach |
|---|---|
| Under 5% missing, MCAR | Drop rows or use simple imputation |
| Numeric column with outliers | Median imputation |
| Categorical column | Mode or an "Unknown" category |
| Time series | Forward/backward fill or interpolation |
| Strong correlations between features | KNN or iterative imputation |
| Missingness carries meaning (MNAR) | Impute and add a missing-indicator |
| Over 60% missing in a column | Consider dropping the column |
| Missing target value | Drop the row |
Comparing the methods
| Method | Speed | Keeps sample size | Uses other columns | Risk |
|---|---|---|---|---|
| Drop rows | Fast | No | No | Bias, data loss |
| Mean / median / mode | Fast | Yes | No | Reduced variance |
| Forward / backward fill | Fast | Yes | No | Wrong if gaps are long |
| Interpolation | Fast | Yes | No | Assumes a pattern |
| KNN / Iterative | Slower | Yes | Yes | Complexity, overfitting |
Impact of handling missing values well
- Improved data quality — a cleaner dataset is more reliable for analysis and training.
- Better model performance — models train on complete data and predict more accurately.
- Preserved data integrity — consistent, well-documented values for later analysis.
- Reduced bias — patterns reflect reality more closely.
Golden rules
- First find out why the data is missing.
- Convert placeholders like
-999toNaNbefore anything else. - Learn imputation values from the training set only to avoid leakage.
- Put the imputer inside a
Pipeline. - Document what you did and why.