Skip to content
ML Academy

Feature engineering and preprocessing · insight-0114

Let gradient boosting route missing values natively before building an imputer

Evidence type
documented fact
Difficulty
easy
Roles
Data scientist, ML engineer
Industries
cross-industry

Summary: situation, action, reason, boundary

  1. Situation

    You plan an imputation step in front of HistGradientBoosting, LightGBM or XGBoost.

  2. Action

    Start with native missing-value handling as the baseline; add imputation only if it beats native handling on the same folds or is required for serving consistency.

  3. Reason

    These boosters learn, per split, whether missing rows go left or right based on gain, so missingness becomes a learnable signal.

  4. Boundary

    HistGradientBoosting, LightGBM and XGBoost on tabular data with NaN values.

Symptom or risk

Imputation adds code and can hide informative missingness, while the booster could have learned where missing rows belong.

Exceptions

If missingness at serving time will differ from training (a field becomes mandatory), learned routing goes stale; fix the data contract first.

Trade-offs

Native handling is simple but less transparent; explicit imputation is auditable but adds assumptions.

Pitfalls

Encoding missing as zero; LightGBM treats zeros as ordinary values unless zero_as_missing is set, and zero may be a real value.

Lessons and concepts

Claims and their sources