MAPTree: Beating "Optimal" Decision Trees with Bayesian Decision Trees

Colin Sullivan, Mo Tiwari, Sebastian Thrun

Abstract

Decision tree learning often faces a trade-off between the speed of greedy algorithms, the training-set optimality of exhaustive search, and the generalization of Bayesian methods. We present MAPTree, an algorithm that finds the Maximum A Posteriori (MAP) decision tree by framing the problem as an efficient search over an AND/OR graph. MAPTree outperforms "optimal" decision trees (ODTs) by generalizing better to new data and is significantly faster than traditional Bayesian sampling methods like MCMC, often providing a certificate of optimality.

Introduction

Decision trees are a staple of machine learning because they are interpretable and handle mixed data types well. However, they face a "Goldilocks" problem. Greedy algorithms like CART are fast but often overfit the training data by making local, short-sighted decisions. Conversely, "Optimal" Decision Trees (ODTs) attempt to find the tree that maximizes training accuracy for a fixed depth; while mathematically optimal, they are computationally expensive and often overfit even worse than greedy trees by chasing every bit of training accuracy. Bayesian trees (e.g., BCART) treat the tree as a random variable and look for a posterior distribution, which generalizes beautifully but usually relies on slow Markov Chain Monte Carlo (MCMC) sampling. MAPTree bridges this gap by finding the single most probable Bayesian tree (the MAP tree) exactly and efficiently, without the randomness of sampling.

Methodology

MAPTree treats the search for the best tree as a shortest-path problem on an AND/OR graph, formalizing a connection between Bayesian inference and state-space search.

AND/OR Graph Formulation

In this framework, an OR node represents a subproblem (e.g., "classify this subset of data"), while an AND node represents a specific feature split that divides the problem into two independent sub-problems. This structure allows the algorithm to decompose the global optimization problem into manageable local components.

AO* Search and Heuristics

Instead of exploring the entire graph, MAPTree utilizes the AO* algorithm, a best-first search guided by a novel "Perfect Split Heuristic." This admissible and consistent heuristic estimates the maximum possible posterior probability a subtree could achieve if it perfectly classified the remaining data in just one more split. This allows the algorithm to prune large sections of the search space that cannot possibly contain the MAP tree. The algorithm is implemented in optimized C++ with a Python interface, making it accessible for practical use.

Experimental Evaluation

The authors evaluated MAPTree using 16 real-world datasets from the CP4IM repository, including common benchmarks like anneal, audiology, australian-credit, and german-credit. They also utilized synthetic datasets with varying levels of label noise (up to 25%) to test how well the algorithm recovers true underlying structures compared to ODTs.

Performance and Speed

MAPTree demonstrates superior efficiency compared to sampling-based Bayesian methods. In 12 out of 16 real-world benchmarks, it identified higher-quality trees faster than MCMC and Sequential Monte Carlo (SMC) baselines. In 5 datasets, it reached provable optimality within the time limit. Unlike MCMC, which lacks a clear stopping criterion, MAPTree can prove when it has found the best possible tree under the BCART model.

MAPTree finds higher-quality trees faster than MCMC and SMC across various datasets.

Generalization and Interpretability

A key insight is that optimizing for the Bayesian posterior is fundamentally better than optimizing for training accuracy. Because the Bayesian prior naturally penalizes complex trees, the MAP tree is "regularized" by design, leading to better performance on unseen data. MAPTree either outperformed or matched state-of-the-art ODTs (DL8.5 and GOSDT) in test accuracy and log-likelihood across the benchmarks. Crucially, MAPTree achieved these results with significantly smaller trees, enhancing interpretability.

Comparison of tree sizes across different models, showing MAPTree produces more compact and interpretable trees.

Robustness to Noise

Because MAPTree looks for the most probable tree rather than the most accurate one on training data, it is significantly more robust to label noise than ODTs. While ODTs tend to overfit to noise to maximize training metrics, MAPTree's probabilistic framework maintains a more stable and accurate model structure.

Conclusion

MAPTree offers a powerful alternative to both greedy and "optimal" decision tree learners. By finding the MAP tree exactly and efficiently, it provides the generalization benefits of Bayesian modeling with the computational rigor of state-space search. While currently limited by memory consumption on very large datasets, it represents a significant step forward in interpretable machine learning. Future work will focus on more aggressive pruning and memory-efficient graph constructions to handle larger-scale data while maintaining the certificate of optimality.

Summary updated

BibTeX
@inproceedings{sullivan2024maptree,
  author = {Colin Sullivan and Mo Tiwari and Sebastian Thrun},
  title = {{MAPTree: Beating "Optimal" Decision Trees with Bayesian Decision Trees}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i8.28751},
}
Figure