Introduction
Decision trees are a cornerstone of interpretable machine learning, offering a transparent "white-box" model for classification tasks. Despite their popularity, the standard approach to building these trees relies on greedy heuristics like CART (Classification and Regression Trees). While efficient, these heuristics make locally optimal splits at each node, which can lead to globally sub-optimal trees that fail to capture the true underlying patterns in the data.
Finding the absolute optimal decision tree for a given depth is an NP-hard problem. Recent research has explored using Mathematical Optimization (MO) to solve this problem globally. However, existing state-of-the-art MO formulations, such as the Optimal Classification Trees (OCT) model, face a critical scalability challenge: they introduce decision variables and constraints for every single row in the training dataset. This linear dependency on the number of training examples ($R$) causes computation times to explode as datasets grow, limiting the practical application of optimal trees.
The BinOCT Formulation
To address these limitations, this paper introduces BinOCT (Binary encoding for constructing Optimal Classification Trees). BinOCT is a novel Binary Linear Program (BLP) formulation that decouples the number of decision variables from the size of the training set, enabling the discovery of optimal trees on larger datasets much faster than previous methods.
Binary Threshold Encoding
The core innovation of BinOCT lies in how it handles decision thresholds. Traditional MO models often use continuous or integer variables, which can be difficult for solvers to optimize. In contrast, BinOCT uses purely binary variables to model threshold selection as a binary search procedure within each internal node.
As illustrated in Figure 2, the model organizes the potential thresholds for a feature into a binary tree structure. By applying "big-M" constraints—a standard optimization technique used to conditionally activate or deactivate constraints—the solver can navigate this binary search space efficiently. This approach leverages the strengths of modern solvers like CPLEX, which are highly tuned for handling binary decision variables.
Data Aggregation and Complexity
Beyond binary encoding, BinOCT utilizes a clever row aggregation trick to break the $O(R)$ scaling bottleneck. The authors observed that routing constraints do not need to be enforced on a row-by-row basis. Instead, rows that share identical feature values can be grouped together. By summing the constraints for these groups, the total number of constraints in the optimization problem is drastically reduced.
The mathematical framework for this formulation is detailed in Figure 6. Because of this aggregation, the number of decision variables in BinOCT is $O(2^K(F + C + \log(T_{max})))$, where $K$ is the tree depth, $F$ is the number of features, $C$ is the number of classes, and $T_{max}$ is the maximum number of unique threshold values. Notably, the number of training rows ($R$) is absent from this complexity term, representing a fundamental shift in how optimal trees are constructed.
Experimental Evaluation
The authors benchmarked BinOCT against the classical CART heuristic and the OCT optimization model across 16 diverse datasets. The experiments were conducted using the CPLEX 12.8.0 solver with a strict 10-minute time limit per dataset.
The results demonstrated that BinOCT consistently outperformed both CART and OCT at depths 2 and 3. At depth 4, BinOCT maintained its lead, though the margin of improvement narrowed. Crucially, BinOCT was able to find high-quality, near-optimal solutions within the 10-minute window on datasets where previous MO methods stalled or failed to produce a solution.
Conclusion
BinOCT provides a scalable path forward for training optimal classification trees. By replacing row-dependent variables with a binary search encoding and utilizing data aggregation, it allows mathematical optimization to be applied to significantly larger datasets. While the model shows a tendency to overfit at higher depths—capturing noise in the training data due to its high optimization power—future work involving regularization and pruning within the BLP framework promises to further enhance its generalization capabilities.
Summary updated