Drop the rows
Select Drop. The right tail is gone, and the mean in the readout has fallen well below the true mean.
Nothing about dropping is wrong in principle. It is unbiased when the values are missing completely at random, and with a handful of affected rows out of many it is a perfectly reasonable choice.
Here it is a disaster, because the rows removed are not a random sample — they are the large ones. Every statistic computed afterwards describes a population that excludes them.
The other cost is arithmetic. Dropping any row with any missing value across ten columns each 5% missing removes about 40% of the data, even though 95% of every individual column is present.
Select Mean, then Median. Both put a spike at a single value in the middle of the distribution, and both leave the mean below the truth.
They differ in robustness. The mean is dragged by extreme values; the median is not. For a skewed column — income, house prices, time-to-event — the median is the better default, and for a roughly symmetric column the two are close enough that it rarely matters.
What neither can do is invent information. Imputation makes the dataset rectangular so the model will accept it. It does not restore what was lost, and it introduces two distortions worth knowing:
- Variance shrinks. A pile of identical values has none.
- Correlations weaken. The imputed rows carry no relationship to any other column, so they dilute every relationship the column really had.
Keep the fact that it was missing
Select Median + indicator. The imputation is the same; what changes is that a second column is added, holding 1 where the value was missing and 0 otherwise.
This is usually the best simple answer, because in the third case — missing not at random — the absence is itself informative. If high earners decline to answer, then "declined to answer" predicts high earnings, and plain imputation throws that signal away while an indicator preserves it.
It costs one column and no assumptions. It is hard to do worse than the alternatives with it.
| Strategy | Keeps rows | Keeps distribution | Keeps the signal in absence |
|---|
| Drop | no | only if MCAR | no |
| Mean | yes | no, spike at centre | no |
| Median | yes | no, spike at centre | no |
| Median + indicator | yes | no | yes |
| Model-based (kNN, MICE) | yes | better | only with an indicator |
More sophisticated options
k-NN imputation fills a value from similar rows. MICE models each column from the others, iteratively. Both preserve relationships better than a constant and both cost far more computation, and both must be fitted on training data only — they are models, so imputing before the split is [leakage](data_leakage.html).
Also worth knowing: some models handle missing values natively. LightGBM and XGBoost learn a default direction at each split for rows whose value is absent, which is frequently better than anything you would impute by hand.
Where it goes wrong
Imputing before the split. The column mean is computed from the test rows too.
Filling with zero without thinking. Zero is a real value in most columns. A temperature of zero is not a missing temperature.
Dropping rows across many columns at once. A little missingness everywhere removes a lot of data.
Never checking why. Ten minutes finding out what caused the gap is worth more than any choice of strategy.