Handling Missing Data in Decision Trees: A Probabilistic Approach

Pasha Khosravi, antonio vergari, YooJung Choi, Yitao Liang, Guy Van den Broeck

TL;DR

While decision trees are known for their flexibility, existing strategies for handling missing data rely on crude heuristics or restrictive independence assumptions. This paper presents a principled probabilistic framework that decouples tree structure from the data distribution: using tractable probabilistic circuits (PCs), it computes the exact expected prediction over missing features at test time and derives closed-form leaf updates to minimize expected loss during training.

What Problem Does This Paper Address?

Machine learning practitioners often assume decision trees natively handle missing values seamlessly. In practice, however, common implementations rely on heuristics:

  • Imputation (mean/median): Assumes features are entirely independent.
  • C4.5 instance reweighting: Assumes the data distribution factorizes strictly along the tree splits.
  • XGBoost default path routing: Learns a default direction for missing values, but fails when missingness occurs only at test time and can overfit to specific missingness patterns seen during training.

The authors address this gap by asking: Can we handle missing data at both training and inference time in a mathematically principled way, without making unrealistic independence assumptions?

Methods

The core idea is to separate tree induction from modeling the joint input distribution $p(\mathbf{X})$.

                +---------------------------------+
                | Tractable Generative Model p(X) |
                |     (Probabilistic Circuit)     |
                +---------------------------------+
                                |
             Marginal Inference | p_l(x^o) = p(x_path(l), x^o)
                                v
+------------------+    Expected Prediction     +-------------------+
|  Decision Tree   | ------------------------>  | Consistent, Robust|
| (Structure T, Θ) |  or Expected Parameter     |    Predictions    |
+------------------+       Minimization         +-------------------+
  1. Deployment Time (Expected Predictions): When observing a partial instance $\mathbf{x}^o$ with missing values $\mathbf{X}^m$, the optimal prediction is the expectation over all possible completions: $$\mathbb{E}_{\mathbf{X}^m \sim p(\mathbf{X}^m \mid \mathbf{x}^o)}[f_\Theta(\mathbf{x}^o, \mathbf{X}^m)] = \frac{1}{p(\mathbf{x}^o)} \sum_{\ell \in \text{leaves}(T)} \theta_\ell \cdot p(\mathbf{x}_{\text{path}(\ell)}, \mathbf{x}^o)$$ By using Probabilistic Circuits (PCs)—generative models that guarantee exact marginalization in polynomial time—this expectation can be computed tractably in closed form across the tree's leaves.

  2. Learning Time (Expected Parameter Learning): Given fixed tree structures (e.g., pre-trained via XGBoost), the authors fine-tune leaf parameters $\theta_\ell$ by minimizing the expected loss (such as Mean Squared Error) over all possible imputations under the density estimator: $$\theta_\ell^* = \frac{\sum_{(\mathbf{x}^o, y) \in \mathcal{D}_{\text{train}}} y \cdot \frac{p_\ell(\mathbf{x}^o)}{p(\mathbf{x}^o)}}{\sum_{(\mathbf{x}^o, y) \in \mathcal{D}_{\text{train}}} \frac{p_\ell(\mathbf{x}^o)}{p(\mathbf{x}^o)}}$$ The authors also generalize this formulation to include $L_2$ leaf regularization, independent forests (bagging), and additive ensembles (gradient boosting).

Datasets

  • Insurance Dataset: A regression benchmark used to predict individual medical insurance charges based on demographic and lifestyle attributes.
  • Preprocessing: Continuous features were discretized using adaptive binning (penalized likelihood) capped at 10 bins, followed by one-hot encoding (yielding 36 discrete features across 936 training and 402 test/validation instances).
  • Missingness Setup: Evaluated under Missing Completely at Random (MCAR) conditions with missing feature rates $\pi \in \{0.1, 0.2, \dots, 0.9\}$ averaged over 10 independent trials.

Key Insights and Ideas

  • Implicit Imputation Over All Completions: Instead of committing to a single imputed value, expected prediction integrates over every possible completion weighted by its true joint probability under $p(\mathbf{X})$.
  • Closed-Form Leaf Optimization: Under squared error loss, optimizing leaf parameters over partially observed training instances does not require iterative gradient descent; it reduces to a closed-form, weighted ratio of marginal probabilities.
  • XGBoost's Silent Failure Mode: When XGBoost encounters missing features at test time having seen none during training, its default routing heuristic simply sends missing data down the first child branch, resulting in severe performance collapse.

Key Results

Experiments compared standard XGBoost, median imputation, expected predictions, and expected loss fine-tuning across varying missingness levels $\pi$:

  • Missing Only at Deployment (5-tree forest):
  • XGBoost's test RMSE deteriorated catastrophically as $\pi$ grew (surpassing $20 \times 10^3$ RMSE at $\pi \ge 0.5$).
  • Median imputation performed better than XGBoost but leveled off around $11\text{--}12 \times 10^3$ RMSE.
  • Expected predictions using PCs achieved the lowest RMSE across all missing rates (consistently remaining below $\approx 11 \times 10^3$).
  • Missing During Both Learning and Deployment (Single tree):
  • Standard XGBoost handled low missingness ($\pi \le 0.4$) reasonably well since it learned default routing directions during training.
  • However, ExpLoss + Expected Prediction (fine-tuning tree leaf weights via expected loss minimization) consistently outperformed both raw XGBoost and simple deployment-time expected prediction across all missingness probabilities ($\pi \in [0.1, 0.9]$).

Limitations and Future Work

  • Discretization Requirement: The specific PC library used required discretizing continuous variables into categorical bins, which may discard fine-grained numerical information.
  • Fixed Tree Topologies: The method optimizes parameters for already induced tree structures rather than integrating expected loss into the greedy split-selection step during tree growth.
  • Benchmark Breadth: Experiments were preliminary, focusing on a single tabular dataset under MCAR assumptions. Evaluating systematic missingness (MAR or MNAR) and larger ensembling architectures remains open for future research.

Summary updated

BibTeX
@inproceedings{khosravi2020handling,
  author = {Pasha Khosravi and antonio vergari and YooJung Choi and Yitao Liang and Guy Van den Broeck},
  title = {{Handling Missing Data in Decision Trees: A Probabilistic Approach}},
  booktitle = {Artemiss @ ICML},
  year = {2020},
  url = {https://openreview.net/forum?id=0IXcmQIAJPt},
}
Figure