Optimal Decision Trees for Nonlinear Metrics

Emir Demirovic, Peter J. Stuckey

Introduction

In machine learning, the pursuit of "optimal" models often defaults to maximizing simple accuracy. While effective for balanced datasets, this approach frequently fails in real-world scenarios characterized by class imbalance. For instance, in a medical screening where 99% of patients are healthy, a model that predicts "healthy" for everyone achieves 99% accuracy but provides zero clinical value. To address this, practitioners turn to nonlinear metrics such as the F1-score or Matthews Correlation Coefficient (MCC). However, these metrics have historically been difficult to optimize directly within decision tree frameworks.

The Challenge of Nonlinear Optimization

Standard algorithms for building optimal decision trees rely on the property of "decomposability." This allows the algorithm to optimize left and right subtrees independently and aggregate their scores. Nonlinear metrics break this independence; the value of a classification error in one branch depends on the total number of errors across the entire tree. Consequently, until now, there was no guaranteed method to find a decision tree that is truly optimal for these complex metrics.

Methodology: A Bi-Objective Approach

The researchers propose a novel solution by reframing the problem as a bi-objective optimization task. Instead of targeting a single nonlinear score, the algorithm treats the number of False Positives ($fp$) and False Negatives ($fn$) as two separate objectives to be minimized simultaneously.

The Pareto Frontier

For any monotonic metric—where fewer mistakes are always preferred—the optimal tree must reside on the Pareto frontier. This frontier represents the set of all trees where one type of error cannot be reduced without increasing the other. By identifying this frontier, the algorithm can find the optimal tree for any monotonic metric (F1, MCC, etc.) in a single search.

Dataset characteristics and the size of the Pareto frontier (|PF|) alongside pruning efficiency metrics.

Algorithmic Innovations

To handle the computational complexity of bi-objective optimization, the authors introduced several key techniques:

  • Bi-Objective Dynamic Programming: A recursive formula that returns sets of non-dominated $(fp, fn)$ pairs.
  • Generalized Pruning: New bounding techniques that discard branches if their best possible trade-offs are mathematically inferior to existing solutions.
  • Specialized Depth-2 Solver: A high-speed sub-routine for small subtrees to accelerate the base cases of the recursion.

Experimental Results

The algorithm was rigorously tested on 75 binary classification datasets from the UCI Machine Learning Repository, including benchmarks like banknote, diabetes, and spambase.

Performance and Generalization

The results demonstrate that direct optimization for nonlinear metrics significantly improves performance on imbalanced data. For example, on the seismic_bumps dataset, the F1-score improved from 0.02 (when tuned for accuracy) to 0.31 (when tuned for F1).

Comprehensive performance comparison of Accuracy-Tuned vs. F1-Score-Tuned decision trees for depths 3 and 4.

Computational Feasibility

Despite the theoretical complexity, the algorithm successfully produced optimal trees up to depth 4 within a one-hour time limit for most datasets. The pruning techniques proved essential, often reducing runtimes by an order of magnitude compared to naive approaches.

Conclusion

This work provides the first certificate of optimality for decision trees under nonlinear metrics. By leveraging bi-objective optimization and the Pareto frontier, the researchers have bridged the gap between the need for interpretable models and the requirement for robust performance on imbalanced data. Future work will look toward scaling these methods to deeper trees and incorporating sparsity constraints to balance accuracy with model simplicity.

Summary updated

BibTeX
@inproceedings{demirovic2021optimal,
  author = {Emir Demirovic and Peter J. Stuckey},
  title = {{Optimal Decision Trees for Nonlinear Metrics}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i5.16490},
}
Figure