Decision trees and randomized forests are widely used in computer vision and machine learning. Standard algorithms for decision tree induction optimize the split functions one node at a time according to some splitting criteria. This greedy procedure often leads to suboptimal trees. In this paper, we present an algorithm for optimizing the split functions at all levels of the tree jointly with the leaf parameters, based on a global objective. We show that the problem of finding optimal linear-combination (oblique) splits for decision trees is related to structured prediction with latent variables, and we formulate a convex-concave upper bound on the tree's empirical loss. The run-time of computing the gradient of the proposed surrogate objective with respect to each training exemplar is quadratic in the the tree depth, and thus training deep trees is feasible. The use of stochastic gradient descent for optimization enables effective training with large datasets. Experiments on several classification benchmarks demonstrate that the resulting non-greedy decision trees outperform greedy decision tree baselines.READ FULL TEXT VIEW PDF
We propose a novel algorithm for optimizing multivariate linear threshol...
This short article presents a new implementation for decision trees. By
Decision tree classifiers are a widely used tool in data stream mining. ...
We present an algorithm for classification tasks on big data. Experiment...
We show how neural models can be used to realize piece-wise constant
The problem of selecting small groups of itemsets that represent the dat...
Decision trees are popular Classification and Regression tools and, when...
. Recent years have seen an increase in their popularity, owing to their computational efficiency and applicability to large-scale classification and regression tasks. A case in point is Microsoft Kinect where decision trees are trained on millions of exemplars to enable real-time human pose estimation from depth images.
Conventional algorithms for decision tree induction are greedy. They grow a tree one node at a time following procedures laid out decades ago by frameworks such as ID3  and CART . While recent work has proposed new objective functions to guide greedy algorithms [21, 12], it continues to be the case that decision tree applications (e.g., [9, 14]) utilize the same dated methods of tree induction. Greedy decision tree induction builds a binary tree via a recursive procedure as follows: beginning with a single node, indexed by , a split function is optimized based on a corresponding subset of the training data such that is split into two subsets, which in turn define the training data for the two children of the node . The intrinsic limitation of this procedure is that the optimization of is solely conditioned on , i.e., there is no ability to fine-tune the split function based on the results of training at lower levels of the tree. This paper addresses this limitation by proposing a general framework for non-greedy learning of the split parameters for tree-based methods. We focus on binary trees, while extension to -ary trees is possible. We show that our joint optimization of the split functions at different levels of the tree under a global objective not only promotes cooperation between the split nodes to create more compact trees, but also leads to better generalization performance.
One of the key contributions of this work is establishing a link between the decision tree optimization problem and the problem of structured prediction with latent variables . We present a novel formulation of the decision tree learning that associates a binary latent decision variable with each split node in the tree and uses such latent variables to formulate the tree’s empirical loss. Inspired by advances in structured prediction [24, 25, 26], we propose a convex-concave upper bound on the empirical loss. This bound acts as a surrogate objective that is optimized using stochastic gradient descent (SGD) to find a locally optimal configuration of the split functions. One complication introduced by this particular formulation is that the number of latent decision variables grows exponentially with the tree depth . As a consequence, each gradient update will have a complexity of for -dimensional inputs. One of our technical contributions is showing how this complexity can be reduced to by modifying the surrogate objective, thereby enabling efficient training of deep trees.
Finding optimal split functions at different levels of a decision tree according to some global objective, such as a regularized empirical risk, is NP-complete  due to the discrete and sequential nature of the decisions in a tree. Thus, finding an efficient alternative to the greedy approach has remained a difficult objective despite many prior attempts.
proposes a non-greedy multi-linear programming based approach for global tree optimization and shows that the method produces trees that have higher classification accuracy than standard greedy trees. However, their method is limited to binary classification with- loss and has a high computation complexity, making it only applicable to trees with few nodes.
The work in  proposes a means for training decision forests in an online setting by incrementally extending the trees as new data points are added. As opposed to a naive incremental growing of the trees, this work models the decision trees with Mondrian Processes.
The Hierarchical Mixture of Experts model 
uses soft splits rather than hard binary decisions to capture situations where the transition from low to high response is gradual. The use of soft splits at internal nodes of the tree yields a probabilistic model in which the log-likelihood is a smooth function of the unknown parameters. Hence, training based on log-likelihood is amenable to numerical optimization via methods such as expectation maximization (EM). That said, the soft splits necessitate the evaluation of all or most of the experts for each data point, so much of the computational advantage of the decision trees are lost.
Murthy and Salzburg  argue that non-greedy tree learning methods that work by looking ahead are unnecessary and sometimes harmful. This is understandable since their methods work by minimizing empirical loss without any regularization, which is prone to overfitting. To avoid this problem, it is a common practice (see Breiman  or Criminisi and Shotton  for an overview) to limit the tree depth and introduce limits on the number of training instances below which a tree branch is not extended, or to force a diverse ensemble of trees (i.e., a decision forest) through the use of bagging  or boosting . Bennett and Blue 
describe a different way to overcome overfitting by using max-margin framework and the Support Vector Machines (SVM) at the split nodes of the tree. Subsequently, Bennettet al. 
show how enlarging the margin of decision tree classifiers results in better generalization performance.
Our formulation for decision tree induction improves on prior art in a number of ways. Not only does our latent variable formulation of decision trees enable efficient learning, but it also handles any general loss function while not sacrificing thecomplexity of inference imparted by the tree structure. Further, our surrogate objective provides a natural way to regularize the joint optimization of tree parameters to discourage overfitting.
For ease of exposition, this paper focuses on binary classification trees, with internal (split) nodes, and leaf (terminal) nodes. Note that in a binary tree the number of leaves is always one more than the number of internal (non-leaf) nodes. An input, , is directed from the root of the tree down through internal nodes to a leaf node. Each leaf node specifies a distribution over class labels. Each internal node, indexed by , performs a binary test by evaluating a node-specific split function . If evaluates to , then is directed to the left child of node . Otherwise, is directed to the right child. And so on down the tree. Each split function , parameterized by a weight vector , is assumed to be a linear threshold function, i.e., . We incorporate an offset parameter to obtain split functions of the form by appending a constant “” to the input feature vector.
Each leaf node, indexed by
, specifies a conditional probability distribution over class labels,, denoted . Leaf distributions are parametrized with a vector of unnormalized predictive log-probabilities, denoted , and a softmax function; i.e.,
where denotes the element of vector .
The parameters of the tree comprise the internal weight vectors, , and the vectors of unnormalized log-probabilities, one for each leaf node, . We pack these parameters into two matrices and whose rows comprise weight vectors and leaf parameters, i.e., and . Given a dataset of input-output pairs, , where is the ground truth class label associated with input , we wish to find a joint configuration of oblique splits and leaf parameters that minimize some measure of misclassification loss on the training dataset. Joint optimization of the split functions and leaf parameters according to a global objective is known to be extremely challenging  due to the discrete and sequential nature of the splitting decisions within the tree.
One can evaluate all of the split functions, for every internal node of the tree, on an input by computing , where is the element-wise sign function. One key idea that helps linking decision tree learning to latent structured prediction is to think of an -bit vector of potential split decisions, e.g., , as a latent variable. Such a latent variable determines the leaf to which a data point is directed, and then classified using the leaf parameters. To formulate the loss for an input-output pair, , we introduce a tree navigation function that maps an -bit sequence of split decisions () to an indicator vector that specifies a -of- encoding. Such an indicator vector is only non-zero at the index of the selected leaf. Fig. 1 illustrates the tree navigation function for a tree with internal nodes.
Using the notation developed above, represents the parameters corresponding to the leaf to which is directed by the split functions in . A generic loss function of the form measures the discrepancy between the model prediction based on and an output . For the softmax model given by (1), a natural loss is the negative log probability of the correct label, referred to as log loss,
For regression tasks, when , and the value of is directly emitted as the model prediction, a natural choice of is squared loss,
One can adopt other forms of loss within our decision tree learning framework as well. The goal of learning is to find and that minimize empirical loss, for a given training set , that is,
Direct global optimization of empirical loss with respect to is challenging. It is a discontinuous and piecewise-constant function of . Furthermore, given an input , the navigation function yields a leaf parameter vector based on a sequence of binary tests, where the results of the initial tests determine which subsequent tests are performed. It is not clear how this dependence of binary tests should be formulated.
To overcome the intractability in the optimization of , we develop a piecewise smooth upper bound on empirical loss. Our upper bound is inspired by the formulation of structured prediction with latent variables . A key observation that links decision tree learning to structured prediction, is that one can re-express in terms of a latent variable . That is,
In this form, decision tree’s split functions implicitly map an input to a binary vector by maximizing a score function , the inner product of and . One can re-express the score function in terms of a more familiar form of a joint feature space on and , as , where , and . Previously, Norouzi et al. [19, 20] used the same re-formulation (5) of linear threshold functions to learn binary similarity preserving hash functions.
Given (5), we re-express empirical loss as,
This objective resembles the objective functions used in structured prediction, and since we do not have a priori access to the ground truth split decisions, , this problem is a form of structured prediction with latent variables.
We develop an upper bound on loss for an input-output pair, , which takes the form,
To validate the bound, first note that the second term on the RHS is maximized by . Second, when , it is clear that the LHS equals the RHS. For all other values of , the RHS can only get larger than when because of the max operator. Hence, the inequality holds. An algebraic proof of (7) is presented in the Appendix.
In the context of structured prediction, the first term of the upper bound, i.e., the maximization over , is called loss-augmented inference, as it augments the standard inference problem, i.e., the maximization over , with a loss term. Fortunately, the loss-augmented inference for our decision tree learning formulation can be solved exactly, as discussed below.
It is also notable that the loss term on the LHS of (7) is invariant to the scale of , but the upper bound on the right side of (7) is not. As a consequence, as with binary SVM and margin-rescaling formulations of structural SVM , we introduce a regularizer on the norm of when optimizing the bound. To justify the regularizer, we discuss the effect of the scale of on the bound.
The upper bound on the loss becomes tighter as a constant multiple of increases, i.e., for :
Please refer to the Appendix for the proof. ∎
In the limit, as the scale of approach , the loss term becomes negligible compared to the score term . Thus, the solutions to loss-augmented inference and inference become almost identical, except when an element of is very close to . Thus, even though a larger yields a tighter bound, it makes the bound approach the loss itself, and therefore becomes nearly piecewise-constant, which is hard to optimize. In fact, based on Proposition 1, one easy way to decrease the upper bound is to increase the norm of , which does not affect the loss.
Our experiments indicate that when the norm of is regularized, a lower value of the loss at both training and validation time can be achieved. We therefore constrain the norm of to obtain an objective with better behavior and generalization. Since each row of acts independently in a decision tree in the split functions, it is reasonable to constrain the norm of each row independently. Summing over the bounds for different training pairs and constraining the norm of rows of , we obtain the following optimization problem, called the surrogate objective:
where is a regularization parameter and is the row of . For all values of , we have . Instead of using the typical Lagrange form for regularization, we employ hard constraints to enable sparse gradient updates of the rows of , since as explained below, the gradients for most rows of are zero at each step of training.
Even though minimizing the surrogate objective of (9) entails non-convex optimization, is much better behaved than empirical loss in (4). is piecewise linear and convex-concave in , and the constraints on define a convex set.
Loss-augmented inference. To evaluate and use the surrogate objective in (9) for optimization, we must solve a loss-augmented inference problem to find the binary code that maximizes the sum of the score and loss terms:
An observation that makes this optimization tractable is that can only take on distinct values, which correspond to terminating at one of the leaves of the tree and selecting a leaf parameter from . Fortunately, for any leaf index , we can solve
efficiently. Note that if , then equals the row of , i.e., . To solve (11) we need to set all of the binary bits in corresponding to the path from the root to the leaf to be consistent with the path direction toward the leaf . However, bits of that do not appear on this path have no effect on the output of , and all such bits should be set based on to obtain maximum . Accordingly, we can essentially ignore the off-the-path bits by subtracting from (11) to obtain,
Note that is constant in , and this subtraction zeros out all bits in that are not on the path to the leaf . So, to solve (12), we only need to consider the bits on the path to the leaf for which is not consistent with the path direction. Using a single depth-first search on the decision tree, we can solve (11) for every , and among those, we pick the one that maximizes (11).
The algorithm described above is , where is the tree depth, and we require a multiple of for computing the inner product at each internal node . This algorithm is not efficient for deep trees, especially as we need to perform loss-augmented inference once for every stochastic gradient computation. In what follows, we develop an alternative more efficient formulation and algorithm with time complexity of .
Fast loss-augmented inference. To develop a faster loss-augmented inference algorithm, we formulate a slightly different upper bound on the loss, i.e.,
where denotes the Hamming ball of radius around , i.e., , hence implies that and differ in at most one bit. The proof of (13) is identical to the proof of (7). The key benefit of this new formulation is that loss-augmented inference with the new bound is computationally efficient. Since and differ in at most one bit, then can only take distinct values. Thus we need to evaluate (12) for at most values of , requiring a running time of .
Stochastic gradient descent (SGD). A reasonable approach to minimizing (9) uses stochastic gradient descent (SGD), the steps of which are outlined in Alg 1. Here, denotes the learning rate, and is the number of optimization steps. Line corresponds to a gradient update in , which is supported by the fact that . Line performs projection back to the feasible region of , and Line updates based on the gradient of the loss. Our implementation modifies Alg 1 by adopting common SGD tricks, including the use of momentum and mini-batches.
Stable SGD (SSGD). Even though Alg 1 achieves good training and test accuracy relatively quickly, we observe that after several gradient updates some of the leaves may end up not being assigned to any data points and hence the full tree capacity may not be exploited. We call such leaves inactive as opposed to active leaves that are assigned to at least one training data point. An inactive leaf may become active again, but this rarely happens given the form of gradient updates. To discourage abrupt changes in the number of inactive leaves, we introduce a variant of SGD, in which the assignments of data points to leaves are fixed for a number of gradient update steps. Thus, the bound is optimized with respect to a set of data point to leaf assignment constraints. When the improvement in the bound becomes negligible the leaf assignment variables are updated, followed by another round of optimization of the bound. We call this algorithm Stable SGD (SSGD) because it changes the assignment of data points to leaves more conservatively than SGD. Let denote the -of- encoding of the leaf to which a data point should be assigned to. Then, SSGD with fast loss-augmented inference relies on the following upper bound on loss,
Computational complexity. To analyze the computational complexity of each SGD and SSGD step, we note that Hamming distance between (defined in (10)) and is bounded above by the depth of the tree . This is because only those elements of corresponding to the path to a selected leaf can differ from . Thus, for SGD the expression needed for Line 6 of Alg 1 can be computed in , if we know which bits of and differ. Accordingly, Lines 6 and 7 can be performed in . The computational bottleneck is the loss augmented inference in Line 5. When fast loss-augmented inference is performed in time, the total time complexity of gradient update for both SGD and SSGD becomes , where is the number of labels.
Experiments are conducted on several benchmark datasets from LibSVM  for multi-class classification, namely SensIT, Connect4, Protein, and MNIST. We use the provided train, validation, test sets when available. If such splits are not provided, we use a random split of the training data for train and validation sets and a random split for train, validation, test sets.
We compare our method for non-greedy learning of oblique trees with several greedy baselines, including conventional axis-aligned trees based on information gain, OC1 oblique trees  that use coordinate descent for optimization of the splits, and random
oblique trees that select the best split function from a set of randomly generated hyperplanes based on information gain. We also compare with the results ofCO2 , which is a special case of our upper bound approach applied greedily to trees of depth , one node at a time. Any base algorithm for learning decision trees can be augmented by post-training pruning , or building ensembles with bagging  or boosting . However, the key differences between non-greedy trees and baseline greedy trees become most apparent when analyzing individual trees. For a single tree the major determinant of accuracy is the size of the tree, which we control by changing the maximum tree depth.
Fig. 2 depicts test and training accuracy for non-greedy trees and four other baselines as function of tree depth. We evaluate trees of depth up to at depth intervals of . The hyper-parameters for each method are tuned for each depth independently. While the absolute accuracy of our non-greedy trees varies between datasets, a few key observations hold for all cases. First, we observe that non-greedy trees achieve the best test performance across tree depths across multiple datasets. Second, trees trained using our non-greedy approach seem to be less susceptible to overfitting and achieve better generalization performance at various tree depths. As described below, we think that the norm regularization provides a principled way to tune the tightness of the tree’s fit to the training data. Finally, the comparison between non-greedy and CO2  trees concentrates on the non-greediness of the algorithm, as it compares our method with its simpler variant, which is applied greedily one node at a time. We find that in most cases, the non-greedy optimization helps by improving upon the results of CO2.
A key hyper-parameter of our method is the regularization constant in (9), which controls the tightness of the upper bound. With a small , the norm constraints force the method to choose a with a large margin at each internal node. The choice of is therefore closely related to the generalization of the learned trees. As shown in Fig. 3, also implicitly controls the degree of pruning of the leaves of the tree during training. We train multiple trees for different values of , and we pick the value of that produces the tree with minimum validation error. We also tune the choice of the SGD learning rate, , in this step. Such and are used to build a tree using the union of both the training and validation sets, which is evaluated on the test set.
To build non-greedy trees, we initially build an axis-aligned tree with split functions that threshold a single feature, optimized using conventional procedures that maximize information gain. The axis-aligned split is used to initialize a greedy variant of the tree training procedure, called CO2 . This provides initial values for and for the non-greedy procedure.
Fig. 4 shows an empirical comparison of training time for SGD with loss-augmented inference and fast loss-augmented inference. As expected, run-time of SGD with loss-augmented inference exhibits exponential growth with deep trees whereas its fast variant is much more scalable. We expect to see better speedup factors for larger datasets. Connect4 only has training points.
We present a non-greedy method for learning decision trees using stochastic gradient descent to optimize an upper bound on the tree’s empirical loss on a training dataset. Our model poses the global training of decision trees in a well-characterized optimization framework. This makes it simpler to pose extensions that could be considered in future work. Efficiency gains could be achieved by learning sparse split functions via sparsity-inducing regularization on . Further, the core optimization problem permits applying the kernel trick to the linear split parameters , making our overall model applicable to learning higher-order split functions or training decision trees on examples in arbitrary reproducing kernel Hilbert spaces.
Acknowledgment. MN was financially supported in part by a Google fellowship. DF was financially supported in part by NSERC Canada and the NCAP program of the CIFAR.
Enlarging the margins in perceptron decision trees.Machine Learning, 41(3):295–313, 2000.
Greedy function approximation: a gradient boosting machine.Annals of Statistics, pages 1189–1232, 2001.
Upper bound on loss. For any pair , the loss is upper bounded by: