Feature-Budgeted Random Forest

Feng Nan, Joseph Wang, Venkatesh Saligrama

Introduction

In many applications such as surveillance and retrieval, we acquire measurements for an entity, and features for a query in order to make a prediction. Features can be expensive and complementary, namely, knowledge of previously acquired feature values often renders acquisition of another feature redundant. In these cases, the goal is to maximize prediction performance given a constraint on the average feature acquisition cost. Our proposed approach is to learn decision rules for prediction-time cost reduction (Kanani & Melville, 2008) from training data in which the full set of features and ground truth labels are available for training.

We propose a novel random forest learning algorithm to minimize prediction error for a user-specified average feature acquisition budget. Random forests (Breiman, 2001) construct a collection of trees, wherein each tree is grown by random independent data sampling & feature splitting, producing a collection of independent identically distributed trees. The resulting classifiers are robust, are easy to train, and yield strong generalization performance.

Although well suited to unconstrained supervised learning problems, applying random forests in the case of prediction-time budget constraints presents a major challenge. First, random forests do not account for feature acquisition costs. If two features have similar utility in terms of power to classify examples but have vastly different costs, random forest is just as likely to select the high cost feature as the low cost alternative. This is obviously undesirable. Second, a key element of random forest performance is the diversity amongst trees (Breiman, 2001). Empirical evidence suggest a strong connection between diversity and performance, and generalization error is bounded not only with respect to the strength of individual trees but also the correlation between trees (Breiman, 2001). High diversity amongst trees constructed without regard for acquisition cost results in trees using a wide range of features, and therefore a high acquisition cost (See Section 3).

Thus, ensuring a low acquisition cost on the forest hinges on growing each tree with high discriminative power and low acquisition cost. To this end, we propose to learn decision trees that incorporates feature acquisition cost. Our random forest grows trees based on greedy minimax cost-weighted-impurity splits. Although the problem of learning decision trees with optimally low-cost is computationally intractable, we show that our greedy approach outputs trees whose cost is closely bounded with respect to the optimal cost. Using these low cost trees, we construct random forests with high classification performance and low prediction-time feature acquisition cost.

Abstractly, our algorithm attempts to solve an empirical risk minimization problem subject to a budget constraint. At each step in the algorithm, we add low-cost trees to the random forest to reduce the empirical risk until the budget constraint is met. The resulting random forest adaptively acquires features during prediction time, with features only acquired when used by a split in the tree. In summary, our algorithm is greedy and easy to train. It can not only be parallelized, but also lends itself to distributed databases. Empirically, it does not overfit and has low generalization error. Theoretically, we can characterize the feature acquisition cost for each tree and for the random forest. Empirically, on a number of benchmark datasets we demonstrate superior accuracy-cost curves against state-of-the-art prediction-time algorithms.

Related Work: The problem of learning from full training data for prediction-time cost reduction (MacKay, 1992; Kanani & Melville, 2008) has been extensively studied. One simple structure for incorporating costs into learning is through detection cascades (Viola & Jones, 2001; Zhang & Zhang, 2010; Chen et al., 2012), where cheap features are used to discard examples belonging to the negative class. Different from our apporach these approaches require a fixed order of features to be acquired and do not generalize well to multi-class. Bayesian approaches have been proposed which model the system as a POMDP (Ji & Carin, 2007; Kapoor & Horvitz, 2009; Gao & Koller, 2011), however they require estimation of the underlying probability distributions. To overcome the need to estimate distributions, reinforcement learning (Karayev et al., 2013; Busa-Fekete et al., 2012; Dulac-Arnold et al., 2011) and imitation learning (He et al., 2012) approaches have also been studied, where the reward or oracle action is predicted, however these generally require classifiers capable of operating on a wide range of missing feature patterns.

Supervised learning approaches with prediction-time budgets have previously been studied under an empirical risk minimization framework to learn budgeted decision trees (Xu et al., 2013; Kusner et al., 2014; Trapeznikov & Saligrama, 2013; Wang et al., 2014b, a). In this setting, construction of budgeted decision cascades or trees has been proposed by learning complex decision functions at each node and leaf, outputting a tree of classifiers which adaptively select sensors/features to be acquired for each new example. Common to these systems is a decision structure, which is a priori fixed. The entire structure is parameterized by complex decision functions for each node, which are then optimized using various objective functions. In contrast we build a random forest of trees where each tree is grown greedily so that global collection of random trees meets the budget constraint.

Construction of simple decision trees with low costs has also been studied for discrete function evaluation problems (Cicalese et al., 2014; Moshkov, 2010; Bellala et al., 2012). Different from our work these trees operate on discrete data to minimize function evaluations, with no notion of test time prediction or cost.

As for Random forests despite their widespread use in supervised learning, to our knowledge they have not been applied to prediction-time cost reduction.

Feature-Budgeted Random Forest

We first present the general problem of learning under prediction-time budgets similar to the formulation in (Trapeznikov & Saligrama, 2013; Wang et al., 2014b). Suppose example/label pairs (x,y)(x,y) are distributed as (x,y)∼dH(x,y)\stackrel{{\scriptstyle d}}{{\sim}}H. The goal is to learn a classifier ff from a family of functions F\mathcal{F} that minimizes expected loss subject to a budget constraint:

where L(y,y^)L(y,\hat{y}) is a loss function, C(f,x)C(f,x) is the cost of evaluating the function of ff on example xx and BB is a user specified budget constraint. In this paper, we assume that the feature acquisition cost C(f,x)C(f,x) is a modular function of the support of the features used by function ff on example xx, that is acquiring each feature has a fixed constant cost. Without the cost constraint, the problem is equivalent to a supervised learning problem, however, adding the cost constraint makes this a combinatorial problem (Xu et al., 2013). In practice, we are not given the distribution but instead are given a set of training data (x1,y1),…,(xn,yn)(x_{1},y_{1}),\ldots,(x_{n},y_{n}) drawn IID with (xi,yi)∼dH(x_{i},y_{i})\stackrel{{\scriptstyle d}}{{\sim}}H. We can then minimize the empirical loss subject to a budget constraint:

In our context the classifier ff is a random forest, T{\cal T}, consisting of KK random trees, D1, D2, …,DKD_{1},\,D_{2},\,\ldots,D_{K}, that are learnt on training data. Consequently, the expected cost for an instance xx during prediction-time can be written as follows:

where, in the RHS we are averaging with respect to the random trees. As the trees in a random forest are identically distributed the RHS scales with the number of trees. This upper-bound captures the typical behavior of a random forest due to the low feature correlation among trees.

As a result of this observation, the problem of learning a budgeted random forest can be viewed as equivalent to the problem of finding decision trees with low expected evaluation cost and error. This motivates our algorithm BudgetRF, where greedily constructed decision trees with provably low feature acquisition cost are added until the budget constraint is met according to validation data. The returned random forest is a feasible solution to (1) with strong empirical performance.

During Training: As shown in Algorithm 1, there are seven inputs to BudgetRF: impurity function FF, prediction-time feature acquisition budget BB, a cost vector C∈ℜmC\in\Re^{m} that contains the acquisition cost of each feature, training class labels ytry_{tr} and data matrix Xtr∈ℜn×mX_{tr}\in\Re^{n\times m}, where nn is the number of samples and mm is the number of features, validation class labels ytvy_{tv} and data matrix XtvX_{tv}. Note that the impurity function FF needs to be admissible, which essentially means monotone and supermodular. We defer the formal definition and theoretical results to Section 2.2. For now it is helpful to think of an impurity function FF as measuring the heterogeneity of a set of examples. Intuitively, FF is large for a set of examples with mostly different labels and small for a set with mostly the same label.

BudgetRF iteratively builds decision trees by calling GreedyTree as a subroutine on a sampled subset of examples from the training data until the budget BB is exceeded as evaluated using the validation data. The ensemble of trees are then returned as output. As shown in subroutine GreedyTree, the tree building process is greedy and recursive. If the given set of examples have zero impurity as measured by FF, they are returned as a leaf node. Otherwise, compute the risk R(t)R(t) for each feature tt, which involves searching for a classifier gtg_{t} among the family of classifiers Gt\mathcal{G}_{t} that minimizes the maximum impurity among its outcomes. Intuitively, a feature with the least R(t)R(t) can uniformly reduce the impurity among all its child nodes the most with the least cost. Therefore such a feature t^\hat{t} is chosen along with the corresponding classifier g^\hat{g}. The set of examples are then partitioned using g^\hat{g} to different child nodes at which GreedyTree is recursively applied. Note that we allow the algorithm to reuse the same feature for the same example in GreedyTree.

During Prediction: Given a test example and a decision forest T\mathcal{T} returned by BudgetRF, we run the example through each tree in T\mathcal{T} and obtained a predicted label from each tree. The final predicted label is simply the majority vote among all the trees.

Different from random forest, we incorporate feature acquisition costs in the tree building subroutine GreedyTree with the hope of reducing costs while maintaining low classification error. Our main theoretical contribution is to propose a broad class of admissible impurity functions such that on any given set of n′n^{\prime} examples the tree constructed by GreedyTree will have max-cost bounded by O(log⁡n′)O(\log n^{\prime}) times the optimal max-cost tree.

2 Bounding the Cost of Each Tree

Given a set of examples SS with features and corresponding labels, a classification tree DD has a feature-classifier pair associated with each internal node. A test example is routed from the root of DD to a leaf node directed by the outcomes of the classifiers along the path; the test example is then labeled to be the majority class among training examples in the leaf node it reaches. The feature acquisition cost of an example s∈Ss\in S on DD, denoted as cost(D,s)cost(D,s), is the sum of all feature costs incurred along the root-to-leaf path in DD traced by ss. Note that if ss encounters a feature multiple times in the path, the feature cost contributes to cost(D,s)cost(D,s) only once because subsequent use of a feature already acquired for the test example incurs no additional cost. We define the total max-cost as

We aim to build a decision tree for any given set of examples such that the max-cost is minimized. Note that the max-cost criterion bounds the expected cost criterion of Eq. 3. While this bound could be loose we show later (see Sec. 2.4) that by parameterizing a suitable class of impurity functions, the max-costs of our GreedyTree solution can be “smoothened” so that it approaches the expected-cost.

First define the following terms: n′n^{\prime} is the number of examples input to GreedyTree and mm is the number of features, each of which has (a vector of) real values; FF is the given impurity function; F(S)F(S) is the impurity on the set of examples SS; DFD_{F} is the family of decision trees with F(L)=0F(L)=0 for any of its leaf LL; each feature has a cost c(t)c(t); a family of classifiers Gt\mathcal{G}_{t} is associated with feature tt; CostF(S)Cost_{F}(S) is the max-cost of the tree constructed by GreedyTree using impurity function FF on SS; and assume no feature is used more than once on the same example in the optimal decision tree among DFD_{F} that achieves the minimum max-cost, which we denote as OPT(S)OPT(S) for the given input set of examples SS. Note the assumption here is a natural one if the complexity of Gt\mathcal{G}_{t} is high enough. We show the O(log⁡n′)O(\log n^{\prime}) approximation holds for the max-cost of the optimal testing strategy using the GreedyTree subroutine if the impurity function FF is admissible.

A function FF of a set of examples is admissible if it satisfies the following five properties: (1) Non-negativity: F(G)≥0F(G)\geq 0 for any set of examples GG; (2) Purity: F(G)=0F(G)=0 if GG consists of examples of the same class; (3) Monotonicity: F(G)≥F(R),∀R⊆GF(G)\geq F(R),\forall R\subseteq G; (4) Supermodularty: F(G∪j)−F(G)≥F(R∪j)−F(R)F(G\cup j)-F(G)\geq F(R\cup j)-F(R) for any R⊆GR\subseteq G and example j∉Rj\notin R; (5) log⁡(F(S))=O(log⁡n′)\log(F(S))=O(\log n^{\prime}).

Since the set SS is always finite, by scaling FF we can assume the smallest non-zero impurity of FF is 1. Let τ\tau and g^τ\hat{g}_{\tau} be the first feature and classifier selected by GreedyTree at the root and let Sg^τiS^{i}_{\hat{g}_{\tau}} be the set of examples in SS that has outcome ii using classifier g^τ\hat{g}_{\tau}. Note the optimization of classifier in Line (15) of Algorithm 1 needs not to be exact. We say GreedyTree is λ\lambda-greedy if g^τ\hat{g}_{\tau} is chosen such that

for some constant λ≥1\lambda\geq 1. By definition of max-cost,

because feature τ\tau could be selected multiple times by GreedyTree along a path and the feature cost c(τ)c(\tau) contributes only once to the cost of the path.

Let qq be such that CostF(Sg^τq)=max⁡iCostF(Sg^τi)Cost_{F}(S^{q}_{\hat{g}_{\tau}})=\underset{i}{\max}Cost_{F}(S^{i}_{\hat{g}_{\tau}}). We first provide a lemma to lower bound the optimal cost, which will later be used to prove a bound on the cost of the tree.

Let FF be monotone and supermodular; let τ\tau and g^τ\hat{g}_{\tau} be the first feature and classifier chosen by GreedyTree λ\lambda-greedily on the set of examples SS, then

Let D∗∈DFD^{*}\in D_{F} be a tree with optimal max-cost. Let vv be an arbitrarily chosen internal node in D∗D^{*}, let γ\gamma be the feature associated with vv and gγ∗g^{*}_{\gamma} the corresponding classifier. Let R⊆SR\subseteq S be the set of examples associated with the leaves of the subtree rooted at vv. Let ii be such that c(τ)/(F(S)−F(Sg^τi))c(\tau)/(F(S)-F(S^{i}_{\hat{g}_{\tau}})) is maximized. Let gγmin=argmin⁡gγ∈Gγmax⁡i∈outcomesc(γ)F(S)−F(Sgγi)g^{min}_{\gamma}=\underset{g_{\gamma}\in\mathcal{G}_{\gamma}}{\operatornamewithlimits{argmin}}\underset{i\in\text{outcomes}}{\max}\frac{c(\gamma)}{F(S)-F(S^{i}_{g_{\gamma}})}. Let ww be such that c(γ)/(F(S)−F(Sgγminw))c(\gamma)/(F(S)-F(S^{w}_{g^{min}_{\gamma}})) is maximized; similarly let jj be such that c(γ)/(F(S)−F(Sgγ∗j))c(\gamma)/(F(S)-F(S^{j}_{g^{*}_{\gamma}})) is maximized. We then have:

The first inequality follows from the definition of ii. The second inequality follows from the λ\lambda-greedy choice at the root. The third inequality follows from the minimization over classifiers given feature γ\gamma. To show the last inequality, we have to show F(S)−F(Sgγ∗j)≥F(R)−F(Rgγ∗j)F(S)-F(S^{j}_{g^{*}_{\gamma}})\geq F(R)-F(R^{j}_{g^{*}_{\gamma}}). This follows from the fact that Sgγ∗j∪R⊆SS^{j}_{g^{*}_{\gamma}}\cup R\subseteq S and Rgγ∗j=Sgγ∗j∩RR^{j}_{g^{*}_{\gamma}}=S^{j}_{g^{*}_{\gamma}}\cap R and therefore F(S)≥F(Sgγ∗j∪R)≥F(Sgγ∗j)+F(R)−F(Rgγ∗j)F(S)\geq F(S^{j}_{g^{*}_{\gamma}}\cup R)\geq F(S^{j}_{g^{*}_{\gamma}})+F(R)-F(R^{j}_{g^{*}_{\gamma}}), where the first inequality follows from monotonicity and the second follows from the definition of supermodularity.

For a node vv, let S(v)S(v) be the set of examples associated with the leaves of the subtree rooted at vv. Let v1,v2,…,vpv_{1},v_{2},\dots,v_{p} be a root-to-leaf path on D∗D^{*} as follows: v1v_{1} is the root of the tree, and for each i=1,…,p−1i=1,\dots,p-1 the node vi+1v_{i+1} is a child of viv_{i} associated with the branch of jj that maximizes c(ti)/(F(S)−F(Sgti∗j))c(t_{i})/(F(S)-F(S^{j}_{g^{*}_{t_{i}}})), where tit_{i} is the test associated with viv_{i}. It follows from (4) that

Since the cost of the path from v1v_{1} to vpv_{p} is no larger than the max cost of the D∗D^{*}, we have that

The main theorem of this section is the following.

GreedyTree constructs a decision tree achieving O(log⁡n′)O(\log n^{\prime})-factor approximation of the optimal max-cost in DFD_{F} on the set SS of n′n^{\prime} examples if FF is admissible and no feature is used more than once on any path of the optimal tree.

The inequality in (7) follows from the fact that OPT(S)≥OPT(Sg^τq)OPT(S)\geq OPT(S^{q}_{\hat{g}_{\tau}}). (8) follows from Lemma 2.1. The first term in (9) follows from the inequality xx+1≤log⁡(1+x)\frac{x}{x+1}\leq\log(1+x) for x>−1x>-1 and the second term follows from the induction hypothesis that for each G⊂SG\subset S, CostF(G)/OPT(G)≤λlog⁡(F(G))+1{Cost_{F}(G)}/{OPT(G)}\leq\lambda\log(F(G))+1. If F(G)=0F(G)=0 for some set of examples GG, we define CostF(G)/OPT(G)=1{Cost_{F}(G)}/{OPT(G)}=1.

We can verify the base case of the induction as follows. if F(G)=1F(G)=1, which is the smallest non-zero impurity of FF on subsets of examples SS, we claim that the optimal decision tree chooses the feature with the smallest cost among those that can reduce the impurity function FF:

Suppose otherwise, the optimal tree chooses first a feature tt with a child node G′G^{\prime} such that F(G′)=1F(G^{\prime})=1 and later chooses another feature t′t^{\prime} such that all the child nodes of G′G^{\prime} by gt′g_{t^{\prime}} has zero impurity, then t′t^{\prime} could have been chosen in the first place to reduce all child nodes of GG to zero impurity by supermodularity of FF. On the other hand, R(t)=∞R(t)=\infty in GreedyTree for the features that cannot reduce impurity and R(t)=c(t)R(t)=c(t) for those features that can. So the algorithm would pick the feature among those that can reduce impurity and have the smallest cost. Thus, we have shown that CostF(G)/OPT(G)=1≤λlog⁡(F(G))+1{Cost_{F}(G)}/{OPT(G)}=1\leq\lambda\log(F(G))+1 for the base case.

3 Admissible Impurity Functions

A wide range of functions falls into the class of admissible impurity functions. We employ a particular function called threshold-Pairs in our paper defined as

where nGin_{G}^{i} denotes the number of objects in GG that belong to class ii, [x]+=max⁡(x,0)[x]_{+}=\max(x,0) and α\alpha is a threshold parameter. We include the proof of the following lemma in the Appendix.

Neither entropy nor Gini index satisfies the notion of admissibility because they are not monotonic set functions, that is a subset of examples does not necessarily have a smaller entropy or Gini index compared to the entire set. Therefore traditional decision tree learning algorithms do not incorporate feature costs and have no guarantee on the max-cost as stated in our paper. We have studied more impurity functions that are admissible such as the polynomials and Powers family of functions. After conducting experiments on smaller datasets we noted that they do not offer significant advantage over the threshold-Pairs used in this paper. Please see Appendix for more details.

4 Discussions of the Algorithm

Before concluding the BudgetRF algorithm and its analysis, we discuss further various design issues as well as their implications.

Choice of threshold α\alpha. In subroutine GreedyTree, each tree is greedily built until a minimum leaf impurity is met, then added to the random forest. The threshold α\alpha can be used to trade-off between average tree depth and number of trees. A lower α\alpha results in deeper trees with higher classification power and acquisition cost. As a result, fewer trees are added to the random forest before the budget constraint is met. Conversely, a higher α\alpha yields shallower trees with poorer classification performance, however due to the low cost of each tree, many are added to the random forest before the budget constraint is met. As such, α\alpha can be viewed as a bias-variance trade-off. In practice, it is selected using validation dataset.

Another observation we make is that the choice of α\alpha can potentially lead to different feature choice when used in GreedyTree. To illustrate this point, consider the toy example in Figure 1. A set GG has 30 examples in class 1 (circles) and 30 examples in Class 2 (triangles). Two features t1t_{1} and t2t_{2} are available to the algorithm at equal cost. Feature t1t_{1} has only one classifier in Gt1\mathcal{G}_{t_{1}} as drawn on the upper left of the figure, which can separate 20 examples of Class 2 from the rest of the examples while t2t_{2} has only one classifier in Gt2\mathcal{G}_{t_{2}} as drawn on the lower left of the figure, which evenly divides the examples into halves with equal number of examples from Class 1 and Class 2 in either half. Intuitively, t2t_{2} is not a useful feature from a classification point of view because it cannot separate examples based on class at all. This is reflected in the right plot of Figure 1: choosing t2t_{2} increases cost but does not reduce classification error while choosing t1t_{1} reduces the error to 16\frac{1}{6}. If α\alpha is set to 0 in the threshold-Pairs, feature t2t_{2} will be chosen due to the fact that Pairs biases towards feature-classifiers with balanced outcomes. In contrast, setting α=8\alpha=8 leads to feature t1t_{1}, and therefore may be preferable (see Appendix).

Minimax-splits. The splitting criterion in the subroutine GreedyTree is based on the worst case impurity among child nodes, we call such splits minimax-splits as opposed to expected-splits, which is based on the expected impurity among child nodes. Using minimax-splits, our theoretical guarantee is a bound on the max-cost of individual trees. Note such minimax-splits have been shown to lead to expected-cost bound as well in the setting of GBS (Nowak, 2008); an interesting future research direction is to show whether minimax-splits can lead to a bound on the expected-cost of individual trees in our setting.

Smoothened Max-Costs. We emphasize that by adjusting α\alpha in threshold-Pairs function - essentially allowing some error, the max-costs of the GreedyTree solution can be “smoothened” so that it approaches the expected-cost. Consider the synthetic example as shown in Figure 2.

Here we consider a multi-class classification example to demonstrate the effect of “smoothened” max-cost of the tree approaching the expected-cost. Consider a data set composed of 1024 examples belonging to 4 classes with 10 binary features available. Assume that is no two examples that have the same set of feature values. Note that by fixing the acquisition order of the features, the set of feature values maps each example to an integer in the range .Fromthismapping,wegivetheexamplesintheranges. From this mapping, we give the examples in the ranges , ,,, and $thelabelsthe labels1,,2,,3,and, and4,respectively,andtheexamples,, respectively, and the examples ,256,,512,and, and768thelabelsthe labels2,,3,,4,and, and1, respectively (Figure 2 shows the data projected to the first two features). Suppose each feature carries a unit cost. By Kraft’s Inequality (Cover & Thomas, 1991), the optimal max-cost in order to correctly classify every object is 10, however, using onlyt_{1}andandt_{2}$ as selected by the greedy algorithm, leads to a correct classification of all but 4 objects, as shown in Figure 3. Thus, the max-cost of the early stopped tree is only 2 - much closer to the expected-cost.

Experiments

For establishing baseline comparisons we apply BudgetRF on 4 real world benchmarked datasets. The first one has varying feature acquisition costs in terms of computation time and the purpose is to show our algorithm can achieve high accuracy during prediction while saving massive amount of feature acquisition time. The other 3 datasets do not have explicit feature costs; instead, we assign a unit cost to each feature uniformly. The purpose is to demonstrate our algorithm can achieve low test error using only a small fraction of features. Note our algorithm is adaptive, meaning it acquires different features for different examples during testing. So the feature costs in the plots should be understood as an average of costs for all test examples. We use CSTC (Xu et al., 2013) and ASTC (Kusner et al., 2014) for comparison because they have been shown to have state-of-the-art cost-error performance. For comparison purposes we use the same configuration of training/validation/test splits as in ASTC/CSTC. The algorithm parameters for ASTC are set using the same configuration as in (Kusner et al., 2014). We report values for CSTC from (Kusner et al., 2014). In all our experiments we use the threshold-Pairs (11) as impurity function. We use stumps as the family of classifiers Gt\mathcal{G}_{t} for all features t. The optimization of classifiers in line 12 of Algorithm 1 is approximated by randomly generating 80, 40 and 20 stumps if the number of examples exceeds 2000, 500 and less than 500, respectively and select the best among them. All results from our algorithm were obtained by taking an average of 10 runs and standard deviations are reported using error bars.

Yahoo! Learning to Rank: (Chapelle et al., ) We evaluate BudgetRF on a real world budgeted learning problem: Yahoo! Learning to Rank Challenge http://webscope.sandbox.yahoo.com/catalog.php?datatype=c. The dataset consists of 473,134473,134 web documents and 19,94419,944 queries. Given a set of training query-document pairs together with relevance ranks of documents for each query, the Challenge is to learn an algorithm which takes a new query and its set of associated documents and outputs the rank of these documents with respect to the new query. Each example xix_{i} contains 519 features of a query-document pair. Each of these features is associated with an acquisition cost in the set {1,5,20,50,100,150,200}\{1,5,20,50,100,150,200\}, which represents the units of time required for extraction and is provided by a Yahoo! employee. The labels are binarized so that yi=0y_{i}=0 means the document is unrelated to the query in xix_{i} whereas yi=1y_{i}=1 means the document is relevant to the query. There are 141,397/146,769/184,968141,397/146,769/184,968 examples in training/validation/test sets. We use the Average Precision@5 as performance metric, same as that used in (Kusner et al., 2014). To evaluate a predicted ranking for a test query, first sort the documents in decreasing order of the predicted ranks - that is, the more relevant documents predicted by the algorithm come before those that are deemed irrelevant. Take the top 5 documents in this order and reveal their true labels. If all of the documents are indeed relevant (y=1y=1), then the precision score is increased by 1; otherwise, if the first unrelated document appears in position 1≤j≤51\leq j\leq 5, increase the precision score by j−15\frac{j-1}{5}. Finally, the precision score is averaged over the set of test queries. We run BudgetRF using the threshold α=0\alpha=0 for the threshold-Pairs impurity function. To incorporate prediction confidence we simply run a given test example through the forest of trees to leaf nodes and aggregate the number of training examples at these leaf nodes for class and 11 seperately. The ratio of class 11 examples over the sum of class 11 and examples gives the confidence of relevance. The comparison is shown in plot (a) of Figure 4. The precision for BudgetRF rises much faster than ASTC and CSTC. At an average feature cost of 70, BudgetRF already exceeds the precision that ASTC/CSTC can achieve using feature cost of 450 and more. In this experiment the maximum number of trees we build is 140; the precision is set to rise even higher if we were to use more trees. BudgetRF thus represents a better ranking algorithm requiring much less wait time for users of the search engine.

MiniBooNE Particle Identification Data Set: (Frank & Asuncion, ) The MiniBooNE data set is a binary classification task, with the goal of distinguishing electron neutrinos (signal) from muon neutrinos (background). Each data point consists of 50 experimental particle identification variables (features). There are 45,523/19,510/65,03145,523/19,510/65,031 examples in training/validation/test sets. We apply BudgetRF with a set of 10 values of α=\alpha=. For each α\alpha we build a forest of maximum 40 trees using BudgetRF. Each point on the BudgetRF curve in (b) of Figure 4 corresponds to a α\alpha setting and the number of trees that meet the budget level. The final α\alpha is chosen using validation set. Our algorithm clearly achieves lower test error than both ASTC and CSTC on every point of the budget level. Indeed, using just about 6 features on average out of 50 , BudgetRF achieves lower test error than what can be achieved by ASTC or CSTC using any number of features.

Forest Covertype Data Set: (Frank & Asuncion, ) The Forest data set contains cartographic variables to predict 7 forest cover types. Each example contains 54 (10 continuous and 44 binary) features. There are 36,603/15,688/58,10136,603/15,688/58,101 examples in training/validation/test sets. We use the same α\alpha values as in MiniBooNE. The final α\alpha is chosen using validation set. In (c) of Figure 4, ASTC and CSTC struggles to decrease test error even at high feature budget whereas the test error of BudgetRF decreases rapidly as more features are acquired. We believe this dramatic performance difference is partly due to the distinct advantage of BudgetRF in handling mixed continuous and discrete (categorical) data where the optimal decision function is highly non-linear.

CIFAR-10: (Krizhevsky, 2009) CIFAR-10 data set consists of 32x32 colour images in 10 classes. 400 features for each image are extracted using technique described in (Coates & Ng, 2011). The data are binarized by combining the first 5 classes into one class and the others into the second class. There are 19,761/8,468/10,00019,761/8,468/10,000 examples in training/validation/test sets. As shown in (d) of Figure 4 BudgetRF initially has higher test error than ASTC when the budget is low; from a budget about 90 onward BudgetRF outperforms ASTC while it outperforms CSTC on the entire curve. An important trend we see is that the errors for both ASTC and CSTC start to increase after some budget level. This indicates an issue of overfitting with these methods. We do not see such an issue with BudgetRF.

As a general comment, we observe that in low-cost regions using higher α\alpha achieves lower test error whereas setting α=0\alpha=0 leads to low test error at a higher cost. This is consistent with our intuition that setting a high value for α\alpha terminates the tree building process early and thus saves on cost, as a consequence more trees can be built within the budget. But as budget increases, more and more trees are added to the forest, the prediction power does not grow as fast as setting α\alpha to low values because the individual trees are not as powerful.

Comments on standard Random Forest Cost is not incorporated in the standard random forest (RF) algorithm. One issue that arises is how to incorporate budget constraint. Our strategy was to limit the number of trees in the RF to control the cost. But this does not work well even if the acquisition costs are uniform for all features. We implemented Matlab version of RF with the default settings on the Forest, MiniBooNE and CIFAR datasets: fraction of input data to sample with replacement from the input data for growing each new tree is 1; number of variables to select at random for each decision split is set to 8; minimum number of observations per tree leaf is 1. Compared to our BudgetRF algorithm using threshold-Pairs impurity with α=0\alpha=0, the feature cost for RF is much higher as shown in Table 1. For example in the Forest experiment, after building 10 trees, RF uses 63.04%63.04\% of total number of features for an average test example whereas BudgetRF uses only 23.21%23.21\%. In terms of test error BudgetRF achieves 0.1364,0.07860.1364,0.0786 and 0.36000.3600 for Forest, MiniBooNE and CIFAR respectively using 10 trees, quite competitive to 0.1318,0.08030.1318,0.0803 and 0.35940.3594 obtained by RF.average over 10 repeated runs of RF and BudgetRF. For Yahoo! Rank dataset, RF does even worse because some features have very high cost and yet RF still uses them just like the less expensive features, resulting in high cost.

Conclusion and Future Work

We propose a novel algorithm to solve the budgeted learning problem. Our approach is to build a random forest of low cost trees with theoretical guarantees. We demonstrate that our algorithm performance far exceeds the state-of-the-art algorithms on 4 real world benchmarked datasets. While we have explored the greedy algorithm based on minimax-splits, similar algorithm can be proposed based on expected-splits. An interesting future work is to examine the theoretical and empirical properties of such algorithms.

References

Appendix

Before showing admissibility of the threshold-Pairs function in the multiclass setting, we first show Fα(G)F_{\alpha}(G) is admissible for the binary setting. Consider the binary classification setting, let

All the properties are obviously true except supermodularity. To show supermodularity, suppose R⊆GR\subseteq G and object j∉Rj\notin R. Suppose jj belongs to the first class. We need to show

Consider 3 cases: (1) Fα(R)=Fα(R∪j)=0F_{\alpha}(R)=F_{\alpha}(R\cup j)=0: The right hand side of (12) is 0 and (12) holds because of monotonicity of FαF_{\alpha}. (2) Fα(R)=0,Fα(R∪j)>0,Fα(G)=0F_{\alpha}(R)=0,F_{\alpha}(R\cup j)>0,F_{\alpha}(G)=0: (12) reduces to Fα(G∪j)≥Fα(R∪j)F_{\alpha}(G\cup j)\geq F_{\alpha}(R\cup j), which is true by monotonicity. (3) Fα(R)=0,Fα(R∪j)>0,Fα(G)>0F_{\alpha}(R)=0,F_{\alpha}(R\cup j)>0,F_{\alpha}(G)>0: Note that Fα(G)>0F_{\alpha}(G)>0 implies that [nG1−α]+[nG2−α]+−α2>0[n^{1}_{G}-\alpha]_{+}[n^{2}_{G}-\alpha]_{+}-\alpha^{2}>0 which further implies nG1>α,nG2>αn_{G}^{1}>\alpha,n_{G}^{2}>\alpha. Thus the left hand side is

If nR1≥αn_{R}^{1}\geq\alpha, Fα(R)=max⁡((nR1−α)(nR2−α)−α2,0)=0F_{\alpha}(R)=\max((n^{1}_{R}-\alpha)(n^{2}_{R}-\alpha)-\alpha^{2},0)=0 because Fα(R∪j)>0F_{\alpha}(R\cup j)>0 implies nR2>αn_{R}^{2}>\alpha. So Fα(R∪j)≤nR2−α≤nG2−α=Fα(G∪j)−Fα(G)F_{\alpha}(R\cup j)\leq n^{2}_{R}-\alpha\leq n_{G}^{2}-\alpha=F_{\alpha}(G\cup j)-F_{\alpha}(G). (4) Fα(R)>0F_{\alpha}(R)>0: We have

This completes the proof for the binary classification setting. To generalize to the multiclass threshold-Pairs function, again, all properties are obviously true except supermodularity, which follows from the fact that each term in the sum is supermodular according to the proof for binary setting.

More Admissible Impurity Functions

The following polynomial impurity function is also admissible.

Suppose there are kk classes in GG. Any polynomial function of nG1,…,nGkn_{G}^{1},\dots,n_{G}^{k} with non-negative terms such that nG1,…,nGkn_{G}^{1},\dots,n_{G}^{k} do not appear as singleton terms is admissible. Formally, if

where γi\gamma_{i}’s are non-negative, pijp_{ij}’s are non-negative integers and for each ii there exists at least 2 non-zero pijp_{ij}’s, then FF is admissible.

Properties (1),(2),(3) and (5) are obviously true. To show FF is supermodular, suppose R⊂GR\subset G and object j^∉R\hat{j}\notin R and j^\hat{j} belongs to class jj, we have

where the first summation index set IjI_{j} is the set of terms that involve nRjn_{R}^{j}. The inequality follows because (nRj+1)pij(n_{R}^{j}+1)^{p_{ij}} can be expanded so the negative term can be canceled, leaving a sum-of-products form for RR, which is term-by-term dominated by that of GG.

Another family of admissible impurity functions is the Powers function.

We compare the threshold-Pairs with various α\alpha values against the Powers function to study the effect of them on the tree building subroutine GreedyTree. We compare performance using 9 data sets from the UCI Repository in Figure 5. We assume that all features have a uniform cost. For each data set, we replace non-unique objects with a single instance using the most common label for the objects, allowing every data set to be complete (perfectly classified by the decision trees). Additionally, continuous features are transformed to discrete features by quantizing to 10 uniformly spaced levels. For trees with a smaller cost (and therefore lower depth), the threshold-Pairs impurity function outperforms the Powers impurity function with early stopping (higher α\alpha leads to earlier stopping), whereas for larger cost (and greater depth), the Powers impurity function outperforms threshold-Pairs. If α\alpha is set to 0, the difference between threshold-Pairs and Powers function is small.

Details of Data Sets

The house votes data set is composed of the voting records for 435 members of the U.S. House of Representatives (342 unique voting records) on 16 measures, with a goal of identifying the party of each member. The sonar data set contains 208 sonar signatures, each composed of energy levels (quantized to 10 levels) in 60 different frequency bands, with a goal of identifying The ionosphere data set has 351 (350 unique) radar returns, each composed of 34 responses (quantized to 10 levels), with a goal of identifying if an event represents a free electron in the ionosphere. The Statlog DNA data set is composed of 3186 (3001 unique) DNA sequences with 180 features, with a goal of predicting whether the sequence represents a boundary of DNA to be spliced in or out. The Boston housing data set contains 13 attributes (quantized to 10 levels) pertaining to 506 (469 unique) different neighborhoods around Boston, with a goal of predicting which quartile the median income of the neighborhood the neighborhood falls. The soybean data set is composed of 307 examples (303 unique) composed of 34 categorical features, with a goal of predicting from among 19 diseases which is afflicting the soy bean plant. The pima data set is composed of 8 features (with continuous features quantized to 10 levels) corresponding to medical information and tests for 768 patients (753 unique feature patterns), with a goal of diagnosing diabetes. The Wisconsin breast cancer data set contains 30 features corresponding to properties of a cell nucleus for 569 samples, with a goal of identifying if the cell is malignant or benign. The mammography data set contains 6 features from mammography scans (with age quantized into 10 bins) for 830 patients, with a goal of classifying the lesions as malignant or benign.

Details of Computation in Figure 1

If α=0\alpha=0, we can compute impurity of each set of interest: F0(G)=30×30=900,F0(Gt11)=30×10=300,F0(Gt12)=0,F0(Gt21)=F0(Gt22)=15×15=225F_{0}(G)=30\times 30=900,F_{0}(G_{t_{1}}^{1})=30\times 10=300,F_{0}(G_{t_{1}}^{2})=0,F_{0}(G_{t_{2}}^{1})=F_{0}(G_{t_{2}}^{2})=15\times 15=225; according to subroutine GreedyTree, we can compute R(t1)=max⁡{1900−300,1900−0}=1600,R(t2)=max⁡{1900−225,1900−225=1675}R(t_{1})=\max\{\frac{1}{900-300},\frac{1}{900-0}\}=\frac{1}{600},R(t_{2})=\max\{\frac{1}{900-225},\frac{1}{900-225}=\frac{1}{675}\} so t2t_{2} will be chosen. On the other hand, the impurities for the threshold-Pairs with α=8\alpha=8 are F8(G)=22×22=484,F8(Gt11)=22×2=44,F8(Gt12)=0,F8(Gt21)=F8(Gt22)=7×7=49F_{8}(G)=22\times 22=484,F_{8}(G_{t_{1}}^{1})=22\times 2=44,F_{8}(G_{t_{1}}^{2})=0,F_{8}(G_{t_{2}}^{1})=F_{8}(G_{t_{2}}^{2})=7\times 7=49; again we can compute R(t1)=max⁡{1484−44,1484−0}=1440,R(t2)=max⁡{1484−49,1484−49=1435}R(t_{1})=\max\{\frac{1}{484-44},\frac{1}{484-0}\}=\frac{1}{440},R(t_{2})=\max\{\frac{1}{484-49},\frac{1}{484-49}=\frac{1}{435}\} so t1t_{1} will be chosen. The above example shows that setting α=0\alpha=0 has a stronger preference to balanced splits and may in some cases lead to poor classification result.