A Mathematical Programming Approach to Optimal Classification Forests

Víctor Francisco Sampedro Blanco, Alberto Japón, Justo Puerto, Peter ZhangarXiv 2022 · DOI

TL;DR

This paper introduces Weighted Optimal Classification Forests (WOCFs), a novel framework that uses Mixed Integer Linear Programming (MIP) to build ensembles of decision trees. By optimizing the entire forest simultaneously rather than greedily, WOCFs achieve the accuracy of massive "black-box" models like Random Forests while maintaining the transparency and interpretability of just a few shallow trees.

What Problem Does This Paper Address?

In machine learning, we often face a "no free lunch" trade-off between accuracy and interpretability.

Standard Classification Trees (like CART) are highly interpretable—you can follow the logic of a single tree easily—but they are often less accurate because they are built using "greedy" algorithms that make the best local split without looking ahead. On the other end of the spectrum, Random Forests and XGBoost are incredibly accurate but consist of hundreds of deep trees, making them "black boxes" that are impossible for a human to audit.

The authors address this gap by asking: Can we use mathematical optimization to find the globally optimal ensemble of a few small trees?

Methods

The core of the paper is a Mixed Integer Linear Programming (MIP) formulation. Unlike traditional methods that build trees one by one, the WOCF model constructs a fixed number of trees ($R$) simultaneously to minimize a joint objective function: the sum of misclassification errors plus a penalty for the total number of splits (complexity).

Key technical contributions include:

  • Simultaneous Construction: The model coordinates trees so they "specialize" in different parts of the feature space.
  • Weighted Voting: Each tree is assigned a weight ($w_r$), and the final classification is a weighted majority vote.
  • MIP Strengthening: Solving MIPs is computationally expensive. The authors introduced "symmetry-breaking" constraints (e.g., sorting trees by their error rates) to prevent the solver from wasting time on redundant permutations of the same forest.
  • Linearization: They used techniques like McCormick envelopes to turn non-linear voting logic into linear constraints that standard solvers (like Gurobi) can handle.

Datasets

The authors evaluated their approach using:

  1. 20 UCI Benchmarks: A variety of standard datasets including Sonar, Heart, Ionosphere, and Breast Cancer Wisconsin. These range from ~200 to ~3,800 observations.
  2. Three Real-World Case Studies:
    • Granted Mortgages: Predicting loan approval.
  3. Hotel Reservations: Predicting booking cancellations.
  4. Airlines Satisfaction: A larger dataset (~100k observations) used to test the model's scalability and interpretability in high-stakes scenarios.

Key Insights and Ideas

  • Horizontal vs. Vertical Growth: Traditional Optimal Classification Trees (OCTs) try to gain accuracy by going deeper (vertical). WOCFs go "horizontal," using multiple shallow trees. The authors find that shallow trees in an ensemble have higher "marginal efficiency" because they aren't as constrained by previous splits as deep nodes in a single tree are.
  • Natural "Perspective" Delegation: One of the most surprising findings was that WOCF trees naturally focus on different subsets of variables. In the Airline Satisfaction case, one tree focused on Age/Wifi, another on Travel Type/Gate location, and a third on Online Boarding. This "division of labor" makes the ensemble much easier to explain than a single, convoluted deep tree.
  • Counterfactual Flexibility: Because the model is an ensemble of simple rules, it’s easier to provide "counterfactual explanations" (e.g., "If your income was $500 higher OR your loan term was shorter, you would have been approved").

Key Results

  • Pareto Improvement: WOCFs consistently provided a better balance of accuracy and interpretability than CART or OCT.
  • Efficiency of Scale: A WOCF with just 3 shallow trees often matched or outperformed a 500-tree Random Forest on small-to-medium datasets.
  • Accuracy: In the Mortgage case study, a 3-tree WOCF achieved ~82% accuracy compared to ~78% for a single optimal tree of greater depth.
  • Interpretability: The case studies demonstrated that WOCF avoids the "redundant variable" problem often seen in deep trees, where the same variable appears in multiple branches at different thresholds, confusing the human reader.

Limitations and Future Work

The primary bottleneck is computational cost. Because MIP is NP-hard, solving WOCFs for very large datasets (millions of rows) or very large forests is currently impractical with off-the-shelf solvers. The authors limited their primary experiments to datasets with up to $10^4$ observations and 100 variables.

Future directions include: * Developing specialized decomposition algorithms (like Benders Decomposition) to solve the MIP faster. * Extending the formulation to handle multiclass classification (the current paper focuses on binary). * Exploring "oblique" splits (hyperplanes involving multiple variables) within the forest framework to further boost accuracy.

Summary updated

Abstract

This paper introduces Weighted Optimal Classification Forests (WOCFs), a new family of classifiers that takes advantage of an optimal ensemble of decision trees to derive accurate and interpretable classifiers. We propose a novel mathematical optimization-based methodology which simultaneously constructs a given number of trees, each of them providing a predicted class for the observations in the feature space. The classification rule is derived by assigning to each observation its most frequently predicted class among the trees. We provide a mixed integer linear programming formulation (MIP) for the problem and several novel MIP strengthening / scaling techniques. We report the results of our computational experiments, from which we conclude that our method has equal or superior performance compared with state-of-the-art tree-based classification methods for small to medium-sized instances. We also present three real-world case studies showing that our methodology has very interesting implications in terms of interpretability. Overall, WOCFs complement existing methods such as CART, Optimal Classification Trees, Random Forests and XGBoost. In addition to its Pareto improvement on accuracy and interpretability, we also see unique properties emerging in terms of different trees focusing on different feature variables. This provides nontrivial improvement in interpretability and usability of the trained model in terms of counterfactual explanation. Thus, despite the apparent computational challenge of WOCFs that limit the size of the problems that can be efficiently solved with current MIP, this is an important research direction that can lead to qualitatively different insights for researchers and complement the toolbox of practitioners for high stakes problems.
BibTeX
@misc{blanco2022mathematical,
  author = {Víctor Francisco Sampedro Blanco and Alberto Japón and Justo Puerto and Peter Zhang},
  title = {{A Mathematical Programming Approach to Optimal Classification Forests}},
  year = {2022},
  eprint = {2211.10502},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.10502},
}
Figure