Learning Optimal Classification Trees Robust to Distribution Shifts

Nathan Justin, Sina Aghaei, Andrés Gómez, Phebe VayanosarXiv 2023

TL;DR

This paper introduces the first optimization method for training optimal classification trees that are robust to distribution shifts in discrete and categorical data. By leveraging mixed-integer linear programming and a clever network flow reformulation, the approach significantly improves both worst-case and average-case accuracy on shifted datasets compared to standard decision trees.

What Problem Does This Paper Address?

Machine learning models often degrade sharply when deployed in the real world because the deployment data distribution differs from the training data—a phenomenon known as distribution shift. This is a critical issue in high-stakes domains like public health and social work, where data is frequently collected via self-reported surveys. Such surveys are highly sensitive to question framing, location, and the interviewee's comfort level.

While decision trees are highly preferred in these domains due to their interpretability, standard training algorithms assume training and testing data come from the exact same distribution. Existing robust decision tree methods either rely on heuristic approximations or assume continuous, real-valued data. This paper fills the gap by providing a mathematically rigorous framework to train optimal classification trees robust to discrete and categorical covariate shifts.

Methods

The authors model the task as a single-stage robust optimization problem. The naive formulation is computationally intractable because the objective function (counting correctly classified points) is highly nonlinear and discontinuous.

To solve this, the authors introduce several key innovations:

  1. Two-Stage Linear Reformulation: They map the classification of data points to a maximum flow problem on a capacitated graph that mirrors the tree structure. By taking the dual of this inner problem, it transforms into a minimum cut problem, yielding a single-stage linear mixed-integer optimization (MIO) problem.
  2. Discrete Uncertainty Sets: They construct a discrete uncertainty set using a cost-and-budget framework. This set is calibrated using a likelihood ratio hypothesis test based on a symmetric geometric distribution, allowing practitioners to tune the level of robustness using a single parameter, $\lambda$.
  3. Tailored Cutting-Plane Algorithm: To handle the massive number of constraints generated by all possible data perturbations, they implement a delayed constraint generation approach. Crucially, they add valid inequalities based on nominal misclassifications that speed up the solver by 225x.

The basic notation and structure of the classification tree used in their formulation are illustrated below:

Illustration of tree notation with internal nodes ($\mathcal{N}$) and leaf nodes ($\mathcal{L}$ friction).

Datasets

The method was evaluated on 12 publicly available datasets from the UCI Machine Learning Repository:

  • balance-scale, breast-cancer, car-evaluation, hayes-roth, house-votes-84, kr-vs-kp, monk1, monk2, monk3, soybean-small, spect, and tic-tac-toe.

These datasets represent a mix of purely integer features, purely categorical features (one-hot encoded during preprocessing), and mixed feature types.

Key Insights and Ideas

  • Robustness as a Natural Regularizer: The authors observed that as the uncertainty budget increases (making the model more robust), the optimal tree naturally becomes shallower. Deeper, more complex trees provide an adversary with more fine-grained opportunities to manipulate features and force misclassifications at a low cost. Robustness inherently promotes sparsity.
  • Avoiding Over-Conservatism: Prior robust MIO tree methods forced predictions to remain identical across all possible perturbations. This paper's formulation allows predictions to change under perturbation, provided the overall worst-case accuracy is maximized. This prevents the model from collapsing into a useless, zero-depth tree when uncertainty is high.
  • Exact Subproblem Solvability: Despite the combinatorial complexity of evaluating worst-case data perturbations, the authors proved that the subproblem decomposes by data point and feature, allowing it to be solved exactly and efficiently in polynomial time ($O(|\mathcal{L}||\mathcal{I}| + |\mathcal{I}|\log|\mathcal{I}|)$).

Key Results

  • Accuracy Boost: Compared to standard regularized optimal trees, the robust trees demonstrated an increase of up to 12.48% in worst-case accuracy and up to 4.85% in average-case accuracy across the evaluated distribution shifts.
  • Algorithmic Efficiency: The tailored valid inequalities allowed the solver to find optimal solutions within seconds for instances that otherwise timed out after 2 hours, achieving an empirical 225x speedup.
  • Lower Price of Robustness: When evaluated on data with no distribution shift, this method retained high nominal accuracy, significantly outperforming alternative robust tree baselines which suffered massive accuracy drops due to over-conservatism.

Limitations and Future Work

  • Computational Scalability: Because the framework relies on Mixed-Integer Optimization (MIO), which is NP-hard, the training time scales exponentially with tree depth and the number of features. The experiments in the paper were limited to a maximum tree depth of 5.
  • Future Directions: The authors suggest exploring heuristic or decomposition techniques to scale the robust tree framework to much larger datasets and deeper trees while maintaining robust performance guarantees.

Summary updated

BibTeX
@misc{justin2023learning,
  author = {Nathan Justin and Sina Aghaei and Andrés Gómez and Phebe Vayanos},
  title = {{Learning Optimal Classification Trees Robust to Distribution Shifts}},
  year = {2023},
  eprint = {2310.17772},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.17772},
}
Figure