As a testament to their success, the theory of random forests has long been outpaced by their applicatio application n in practice. practice. In this paper, we take a step towards narrowing this gap by providing a consistency result for online random forests.
present what is to for theonline best ofrandom our knowledge consistency result forests. the first We sho show w that that the theory theory provid provides es guidan guidance ce for designing online random forest algorithms. A few simple experiments with our algorithm confirm the requirements men ts for consisten consistency cy predicted predicted by the theory theory. The experiments also highlight some theoretical and practical problems that need to be addressed.
1. Introduction
2. Related Work
Random forests are a class of ensemble method whose ba base se le lear arne ners rs are are a coll collec ecti tion on of rand random omiz ized ed tree tree predictors predi ctors,, which which are com combined bined through through av averagin eraging. g. The original original random random forests forests fram framewo ework rk described described in Breiman (2001 Breiman 2001)) has been extremely influential (Svet(Svetnik et al., al., 2003; 2003; Prasad et al., al., 2006; 2006; Cutler et al. al.,, 2007 2007;; Shotton et al., 2011;; Criminisi et al. al.,, 2011). 2011). al., 2011
Different variants of random forests are distinguished by the methods methods they use for growing growing the tree trees. s. The 2001)) builds each tree model described in Breiman (2001 on a bootstra bootstrapped pped sample of the training training set using the CART methodology (Breiman (Breiman et al., al., 1984). 1984). The optimization in each leaf that searches for the optimal split point is restricted to a random selection of features, or linear combinations of features.
Despite their extensive use in practical settings, very little is known about the mathematical properties of these algorithms. A recent paper by one of the leading theoretical experts states that Despite growing Despite growing int interest erest and practical practical use, there has been little exploration of the statistical properties of random forests, and little is known about the mathematical forces 2012). driving the algorithm (Biau (Biau,, 2012). Theoretical work in this area typically focuses on stylized versions of the random forests algorithms used in practice. pract ice. For example, example, Biau et al. (2008 2008)) prove the consistency of a variety of ensemble methods built by av avera eragin gingg base base classi classifier fiers. s. Tw Twoo of the mod models els they study are direct simplifications of the forest growing algori algorithm thmss used used in practi practice; ce; the others others are styli stylized zed neighbourhood averaging rules, which can be viewed as simplifications of random forests through the lens 2002). ). of Lin Lin & Jeon ( Jeon (2002 In this paper we make further steps towards narrowing the gap between theory and practice. In particular, we
Preliminary work. Under review by theDo Internation International al Conference on Machine Learning (ICML). not distribute.
The fra framew mework ork of of Cri Crimin minisi isi et al. (2011 2011)) operate operatess slightly differently. Instead of choosing only features at random, this framework chooses entire decisions (i.e. both a feature or combination of features and a threshold together) at random and optimizes only over this set. set. The They y als alsoo offer offer a vari ariet ety y of differen differentt objectiv objectives es which can be optimized to split each leaf, depending on the task at hand hand (e. (e.g. g. classifi classificat cation ion vs manifo manifold ld 2001), thi thiss learni learning) ng).. Unlik Unlikee the work of Breiman (2001), framework chooses not to include bagging, preferring instead to train each tree on the entire data set and introducee randomne troduc randomness ss only in the splitting splitting process. The authors argue that without bagging their model obtains max-margin properties. In addition to the frameworks mentioned above, many practitioners introduce their own variations on the basic random forests algorithm, algorithm, tailored tailored to their specific problem proble m domain. A variant variant from Bosch from Bosch et al. (2007 2007)) is especially similar to the tec technique hnique we use in this paper: When growing a tree the authors randomly select one third of the training data to determine the structure of the tree and use the remaining two thirds to fit the leaf estimat estimators. ors. Howeve However, r, the authors consider this only as a technique for introducing randomness into the trees, whereas in our model the partitioning
of data plays a central role in consistency. In addi additi tion on to thes thesee offline offline me meth thods ods,, sev several eral reresearchers have focused on building online versions of random rando m forests. Online models are attractiv attractivee because they do not require that the entire training set be accessib ces sible le at once. once. These These models are appropri appropriate ate for streaming strea ming settings where training training data is gener generated ated over time and should be incorporated into the model as quickly as possible. Sev Several eral va varian riants ts of online decision tree models are present in the MOA system of Bifet et al. ( 2010). ). al. (2010 The primary difficulty difficulty with building online decisi decision on trees is their recursive recursive nature. Data encountere encountered d once a split has been made cannot be used to correct earlier decisions. decis ions. A notable approach approach to this problem is the gos & Hulten Hulten,, 2000) 2000) algorithm, Hoeffding tree (Domin (Domingos which works by maintaining several candidate splits in each eac h leaf. The quality quality of each each split is estimated estimated online as data arrive in the leaf, but since the entire training set is not available these quality measures are only estimates. The Hoeffding bound is employed in each leaf to control the amount of data which must be collected to ensure that the split chosen on the basis of these estimates is the true best split with high probability. Domingos & Hulten (2000) 2000) prove that under reasonable assumptions the online Hoeffding tree converges to the offline tree with high probability. The Hoeffding tree algorithm is implemented in the system of Bifet of Bifet et al. ( al. (2010 2010). ). Alternative methods for controlling tree growth in an online setting have also been explored. Saffari et al. (2009 2009)) use the online bagging technique of Oza Oza & Russel ( sel (2001 2001)) and control leaf splitting using two parameters,, in their online eters online random forest. forest. One parameter parameter specifies the minimum number of data points which must be seen in a leaf before it can be split, and another specifies a minimum quality that the best split in a leaf must reach. Thisthreshold is similar in flavor to the technique used by Hoeffding trees, but trades theoretical guarantees for more interpretable parameters. One active avenue of research in online random forests involve inv olvess tracking tracking non-statio non-stationary nary distributio distributions, ns, also known as concept drift. Many of the online techniques Gama incorporate incor porate features features designed designed for this problem ((Gama et al., al., 2005 2005;; Abdulsalam, Abdulsalam, 2008; 2008; Saffari Saffari et al. al.,, 2009; 2009; al., 2009 Bifet et al., 2009;; 2012). 2012). Howe Howeve ver, r, tra track cking ing of nonstationarity is beyond the scope of this paper. The most most we well ll known known the theore oretic tical al result result for random random forests is that of Breiman Breiman (2001 2001), ), which gives an upper bound on the generalization error of the forest in
terms terms of the correla correlatio tion n and strength strength of tre trees. es. Following Breiman lowing Breiman (2001), 2001), an interpretation of random forests as an adaptive neighborhood weighting scheme 2002). This This was was folfolwas published in Lin & Jeon (2002). lowed by the first consistency result in this area from Breiman (2004 Breiman ( 2004), ), which proves consistency of a simplified model of the random forests forests used in practice. practice. In the context of quantile regression the consistency of a certain model of random forests has been shown by Meinshausen (2006 2006). ). A model of random random forest forestss for Meinshausen survival analysis was shown to be consistent in Ishwaran & Kogalur ( Kogalur (2010 2010). ). Significant recent work in this direction comes from Biau et al. ( 2008)) who prove the consistency of a varial. (2008 ety of ensemble methods built by averaging base classifiers sifiers,, as is done done in random random forest forests. s. A key key feature feature of the consistency of the tree construction algorithms they present is a proposition that states that if the base classifier is consistent then the forest, which takes a majority majority vote vote of these classifiers, classifiers, is itself consistent consistent.. The most recent theoretical study, and the one which achieves the closest match between theory and practice, is that of Biau ( Biau (2012 2012). ). The most significant significant way way in which their model differs from practice is that it requires a second data set which is not used to fit the leaf predictors in order to make decisions about variable importance importance when growing growing the trees. One of the innovations of the model we present in this paper is a way to circumvent this limitation in an online setting while maintaining consistency.
3. Random Forests In this section we briefly review the random forests framewo fram ework. rk. For a more comprehensiv comprehensivee review review we re Breiman (2001 2001)) and Criminisi and Criminisi et al. fer the reader to Breiman (2011 2011). ). Random forests are built by combining the predictions of several trees, each of which is trained in isolation. 2012) where Unlike in boosting (Schapire ( Schapire & Freund, Freund, 2012) the base classifiers are trained and combined using a sophisticated weighting scheme, typically the trees are trained independently and the predictions of the trees are combined through a simple majority vote. There are three main choices to be made when constructing struc ting a random tree. These are (1) the method for splitting the leafs, (2) the type of predictor to use in each leaf, and (3) the method for injecting randomness into the trees. Specifying Specify ing a method method for splitting leafs requires selecting the shapes of candidate splits as well as a method
for evaluating evaluating the quality of each each candi candidate. date. Typ Typical ical choices here are to use axis aligned splits, where data are routed to sub-trees depending on whether or not they exceed a threshold value in a chosen dimension; or linear splits, where a linear combination of features are thresholde thres holded d to mak makee a decision. decision. The thresh threshold old value in either case can be chosen randomly or by optimizing a function of the data in the leafs.
histograms for the chi histograms childre ldren n eac each h split woul would d create. The rightmost split creates the purest children and will have the greatest information gain.
Each node of the tree is associated with a rectangular each step step of the constr construct uction ion subset of RD , and at each the collection of cells associated with the leafs of the
In order to split a leaf, a collection of candidate splits are generated and a criterion is evaluated to choose between betw een them. A simple strategy is to choose choose among the candidates uniformly at random, as in the mod2008). A mor moree commo common n els analyzed in Biau et al. (2008). approach is to choose the candidate split which optimizes a purity function over the leafs that would be created. creat ed. Typi Typical cal choices choices here are to maximize the information gain, or the Gini gain (Hastie ( Hastie et al., al., 2013). 2013). This situation is illustrated in Figure 1 Figure 1..
The root root of the the tree tree tree Dforms a partition of RD . The itse self lf.. At each each st step ep we re rece ceiv ivee a da data ta point point is R it environment. t. Each Each point is assigned assigned (X t , Y t ) from the environmen to one of two possible streams at random with fixed probabilit proba bility y. We denote denote stream stream membership membership with the variable I t ∈ {s, e}. How How the tree is updated updated at each each time step depends on which stream the corresponding data point is assigned to.
In this section we describe the workings of our online random ran dom forest forest algorith algorithm. m. A more more precis precisee (pseud (pseudoocode)) des code descri cripti ption on of the traini training ng procedu procedure re can be found in Appendix A Appendix A.. 4.1. Forest Construction
The random forest classifier is constructed by building a collection of random tree classifiers in parallel. Each tree is built independently and in isolation from the other trees trees in the forest. forest. Unlike Unlike many other random random forest algorithms we do not preform bootstrapping or subsampling at this level; however, the individual trees each have their own optional mechanism for subsampling the data they receive. Figure 1. Three potential splits for a leaf node and the class
The most common choice for predictors in each leaf is to use the majority vote over the training points which fall in that leaf. Criminisi et al. ( al. (2011 2011)) explore the use of several different leafthese predictors for regression and manifold learning, but genera generalizati lizations ons are beyond the scope of this paper. We consider majority vote classifiers in our model. Injecting randomness into the tree construction can happen in many ways. The choice of which dimensions to use as split candidates at each leaf can be randomized, as well as the choice of coefficients for random combinat com binations ions of features. features. In either case, thresholds thresholds can be chosen either randomly or by optimization over some or all of the data in the leaf.
4.2. Tree Construction
structure stream We refer to the two streams as the structure estimation stream; and the estimation stream; points points assigned assigned to these streams are structure and estimation points, respectively tively.. The These se names names reflect reflect the differe different nt uses of the two streams in the construction of the tree: Structure points are allowed to influence the struc-
ture of the tree partition, i.e. the locations of candidate split points and the statistics used to choose between candidates, but they are not permitted to influence the predictions that are made in each leaf of the tree. Estimation points are not permitted to influence the
shape of the tree partition, but can be used to estimate class membership probabilities in whichever leaf they are assigned to.
Another common method for introducing randomness is to bu build ild ea each ch tree tree us usin ingg a boots bootstr trap apped ped or subsubsampled sampl ed data set. In this way, way, each each tree in the forest
Only two streams are needed to build a consistent forest, but there is no reason we cannot have have more. For ins instan tance, ce, we explored explored the use of a thi third rd str stream eam for points that the tree should ignore completely, which givess a form of online sub-sampling give sub-sampling in each tree. We
is trained on slightly different data, which introduces differences between the trees.
found fou nd performance empiri empirical cally ly that tha t inc includ luding ing thi this s thi third str stream eam hurts of the algorithm, but itsrdpresence
or absence does not affect the theoretical properties. 4.3. Leaf Splitting Mechanism
When a le When leaf af is crea create ted d the the nu num mber of cand candida idate te split dimensions for the new leaf is set to min(1 + λ), D), and this many distinct candidate diPoisson(λ Poisson( mensions mensi ons are selected selected uniformly at random. We then collect m candidate splits in each candidate dimension (m (m is a parameter of the algorithm) by projecting the first m first m structure structure points to arrive in the newly created leaf onto the candidate dimensions. We maintain several sev eral structural structural statistics statistics for each each candi candidate date split. Specifically, for each candidate split we maintain class histograms for each of the new leafs it would create, using data from the estimation stream. We also maintain structural statistics, computed from data in the structure stream, which can be used to choose between the candidate candi date splits. splits. The specific form of the structural structural statistics stati stics does not affect the consistenc consistency y of our model, but it is crucial that they depend only on data in the structure stream. Finally,, we require two Finally two additional additional condition conditionss whic which h control when a leaf at depth d is split: 1. Before a candidate split can be chosen, the class histograms in each of the leafs it would create must incorporate information from at least α(d) estimation points. 2. If an any y leaf leaf receiv receives es more more tha than n β (d) estim estimation ation points, and the previous condition is satisfied for any candidate split in that leaf, then when the any next structure point arrives in this leaf it must be split regardless of the state of the structural statistics. The first condition ensures that leafs are not split too often, and the second condition ensures that no branch of the tree ever stops growing completely. In order to ensure consistency we require that α(d) → ∞ monotonically in in d. We also require require that that β (d) ≥ α(d) for convenience. When a structure point arrives in a leaf, if the first condition condi tion is satisfied satisfied for some candidate candidate split then the leaf may optionally be split at the corresponding point. The decision of whether to split the leaf or wait to collect more data is made on the basis of the structural statistics collected for the candidate splits in that leaf.
number of points we have seen fall in the candidate child, chil d, b both oth counted counted from the structure structure stream. stream. In order to decide if a leaf should be split, we compute the information gain for each candidate split which satisfies condition 1 from the previous section,
|A | | A | I (S ) = H H ((A) − H H ((A ) − H (A ) . |A| |A| S is Here S Here is the candidate split, A is the cell belonging to the leaf to be split, and A and A are the two leafs that would be created if A were split at at S . The H ((A) is the discrete entropy, computed over function H function the labels of the structure points which fall in the cell A. We select the candidate split with the largest information gain for splitting, provided this split achieves a minimum threshold in information gain, τ gain, τ .. The value τ is τ of is a parameter of our algorithm. 4.5. Prediction
At any time the online forest can be used to make predictions for unlabelled data points using the model built from the labelled data it has seen so far. To make a prediction for a query point x at time time t, each tree computes, for each class k class k,, x) = ηtk ( (x
1 N e (At (x))
I {Y τ τ = k }
,
(Xτ ,Y ττ )∈At (x) I ττ =e
where At (x) denotes the leaf of the tree containing x where at time t time t,, and N and N e (At (x)) is the number of estimation points which have been counted in At (x) during its lifetime. lifeti me. Similarly Similarly,, the sum is ov over er the labels of these points. poin ts. The tree tree predic predictio tion n is then the class which which maximizes this value: gt (x) = arg x)} . arg max{ηtk ( (x k
The forest predicts the class which receives the most votes from the individual trees. Note tha Note thatt thi thiss requir requires es that that we maint maintain ain class class his his-togr togram amss fr from om both both the the st stru ruct ctur uree and and es esti tima mati tion on stream streamss separa separatel tely y for each each candid candidate ate child child in the fr frin inge ge of the the tr tree ee.. The The co coun unts ts fr from om the the st stru ruct ctur uree stream stream are used used to sel select ect betwe between en can candid didate ate split split points, and the counts from the estimation stream are used to initialize the parameters in the newly created leafs after a split is made. 4.6. Memory Management
4.4. Structural Statistics
In each candidate child we maintain an estimate of the posterior probability of each class, as well as the total
The typical approach to building trees online, which 2000)) and Safis employed in Domingos & Hulten (2000 fari et al. al. (2009 2009), ), is to maintain a fringe of candidate
childr children en in each each leaf leaf of the tree. tree. The algo algorit rithm hm collects statistics in each of these candidate children until some (algorithm dependent) criterion is met, at which point a pair of candidate children is selected to replace their parent. The selected children become leafs in the new tree, acquiring their own candidate children, and the process repeats. repeats. Our algorit algorithm hm also uses this approach. The difficulty here is that the trees must be grown breadth first, and maintaining the fringe of potential children is very memory intensive when the trees are large.. Our algorithm large algorithm also suffers suffers from this deficiency deficiency, cmd)) statistics in as maintaining the fringe requires O requires O((cmd each leaf, where d where d is the number of candidate split dimensions, m is the number of candidate split points (i.e. md pairs of candidate children per leaf) and c is the number number of classes classes in the pro proble blem. m. The numnumber of leafs grows exponentially fast with tree depth, meaning that for deep trees this memory cost becomes prohibitive. Offline forests do not suffer from this problem, because they are able to grow the trees depth first. Since they do not need to accum accumula ulate te sta statis tistic ticss for more than than one leaf at a time, time, the cost of com comput puting ing eve even n sevseveral megabytes megabytes of statistics statistics per split is negligible. negligible. Although the size of the trees still grows exponentially with depth, this memory cost is dwarfed by the savings from not needing to store split statistics for all the leafs. In practice the memory problem is resolved either by 2009), or by growing small trees, as in Saffari et al. (2009), bounding the number of nodes in the fringe of the tree, as in Domingos & Hulten (2000 2000). ). Ot Othe herr model modelss of streaming random forests, such as those discussed in Abdulsalam ( 2008), ), build trees in sequence instead of Abdulsalam (2008 in parallel, which reduces the total memory usage. Our algorith algorithm m makes makes use of a bounded bounded fringe fringe and adopts the technique of Domingos Domingos & Hulten ( Hulten (2000 2000)) to control the policy for adding and removing leafs from the fringe.
and
• eˆ(At ) which is an estimate P (gt (X ) = Y = Y | X ∈ At ).
of e(A)
=
Both Both of thes thesee ar aree es esti tima mate ted d ba base sed d on the the es esti tima ma-tion tion poin points ts which which arriv arrivee in At during during its lif lifeti etime. me. s A From these two numbers we form the statistic ˆ( ) = p( pˆ(A)ˆ e(A) (with (with corres correspond ponding ing true true value alue s(A) = p( p(A)e(A)) which is an upper bound on the improvement in error rate that can be obtained by splitting A. Membership in the fringe is controlled by ˆs(A). When a leaf is split it relinquishes its place in the fringe and the inactive leaf with the largest value of sˆ(A) is chosen to take its place. The newly created leafs from the split are initially inactive and must compete with the other inactive inact ive leafs for entry into the fringe. 2000), ), who use this techUnlike Domingos & Hulten ( Unlike Domingos Hulten (2000 nique only as a heuristic for managing memory use, we incorporate the memory management directly into our analysis. analy sis. The analysis analysis in Appendix Appendix B shows that our algorithm, including a limited size fringe, is consistent.
5. Theory In this section we state our main theoretical results and give an outline of the strategy for establishing consistency ten cy of our online online random random forest forest algorit algorithm. hm. In the interest of space and clarity we do not include proofs in this section. Unless otherwise otherwise noted, noted, the proofs of all claims appear in Appendix B Appendix B.. We denote the tree partition created by our online random forest algorithm from t data points as gt . As t varies we obtain a sequence of classifiers, and we are interested in showing that the sequence { gt } is consistent, or more precisely that the probability of error of gt converges in probability to the Bayes risk, i.e. L(gt ) = P (gt (X, Z ) = Y | Dt ) → L∗ ,
In each tree we partit partition ion the leafs leafs into two sets: we active leafs, have a set of of active leafs, for which which we collect collect spli splitt statistics as described in earlier sections, and a set of inactive leafs inactive leafs for which we store only two numbers. fringe of the tree, We call the set of active leafs the fringe and describe a policy for controlling how inactive leafs are added to the fringe.
Y )) is a random test point and Z as as t → ∞. Here (X, (X, Y denotes the randomness in the tree construction algo t ) and the probarithm. Dt is the training set (of size t) bility in the convergence is over the random selection of of Dt . The Baye Bayess risk is the probab probabilit ility y of err error or of the Bayes classifier, which is the classifier that makes predictions by choosing the class with the highest posterior probability probability,,
store the fol follo lowin wingg two two In each each inacti inactive ve leaf leaf At we store quantities
g(x) = arg Y = k | X = x x)) , arg max P (Y
• p( pˆ(At ) which is an estimate of µ( µ(At ) = P (X ∈ ∈ A t ),
k
(where ties are broken in ∗favour of the smaller index). The Bayes risk risk L(g ) = L is the minimum achievable
Y ). In risk of any classifier for the distribution of (X, ( X, Y ). order to ease notation, we drop the explicit dependence informaon on Dt in the remainder of this paper. More information about this setting can be found in Devroye in Devroye et al. (1996 1996). ). Our main result is the following theorem: X has a denTheorem 1. Suppose the distribution of X has sity with respect to the Lebesgue measure and that this densit den sityy is bounde ounded d from from ab above ove and below. elow. Then Then the online random forest classifier described in this paper is consistent. The first step in proving Theorem 1 Theorem 1 is is to show that the consistency of a voting classifier, such as a random forest, follows from the consistency of the base classifiers. We prove the following proposition, which is a straightforward generalization of a proposition from Biau from Biau et al. (2008 2008), ), who prove the same result for two class ensembles. Proposition 2. Assume that the sequence { {gt } of randomized classifiers is consistent for a certain distribu(M ) tion of (X, Y Y )). Then Then the voting voting classifie classifier, r, gt ob-
573 tained taking thet)majority vote over M M co (not necessarily ilybyindependen indep endent) copies copies of gt is also consiste nsistent. nt. 574 essar 575 576 Proposition 2 established, the remainder of the 577 With Proposition 578 effort goes into proving the consistency of our tree con579 struction. 580 The first step is to separate the stream splitting ran581 domness from the remaining randomness in the tree 582 construction. We show that if a classifier is condition583 ally consistent based on the outcome of some random 584 vari ariabl able, e, and the sam samplin plingg process process for this this ran random dom 585 variable generates acceptable values with probability 586 1, then the resulting classifier is unconditionally con587 sistent. 588 Proposition 3. Suppose { { gt } is a sequence of classi589 fiers whose probability probability of error converges conditionally 590 in probability to the Bayes risk L∗ for a specified specified dis591 tribu tribution tion on (X, Y )), i.e. ( X, Y 592 P (gt (X,Z,I ) = Y | I ) → L ∗ 593 594 for all all I ∈ I and that that ν ν is a distribution on on I . If 595 ν ( I ) = 1 then the probability of error converges un596 conditionally in probability, i.e. 597 598 Y ) → L ∗ P (gt (X,Z,I ) = Y ) 599 600 In particular, { gt } is consistent for the specified distri601 bution. 602 3 allows us to condition on the random 603 Proposition variables { I t }∞ t=1 which partition the data stream into 604
structure and estimation points in each tree. Provided that the random partitioning process produces acceptablee seq abl sequen uences ces with probab probabilit ility y 1, it is sufficie sufficient nt to show that the random random tree classifier classifier is consisten consistentt conditioned dition ed on such a sequence. sequence. In particular, particular, in the remainder of the argument we assume that { I t }∞ t=1 is a fixed, deterministic sequence which assigns infinitely many points to each of the structure and estimation streams. sequence .We refer to such a sequence as a partitioning S
I
E
Figure 2. The dependency structure of our algorithm. S represents the randomness in the structure of the tree partition, E represents the randomness in the leaf estimators and I represents the randomness in the partitioning of the data stream. E and S are independent conditioned on I .
The reason this is useful is that conditioning on a partitioning sequence breaks the dependence between the structure of the tree partition and the estimators in the leafs. leafs. This This is a powerfu powerfull tool because because it gives gives us access to a class of consistency theorems which rely on this type of independence. However, before we are able to apply these theorems we must further reduce our problem to proving the consistency of estimators of the posterior distribution of each class. Proposi Pro positio tion n 4. Suppose Suppose we hav havee regr gress ession ion estiesti-
x), for for each ach clas classs poste osteri rior or η k (x) = mates, ηtk ( (x P (Y Y = k | X = x)), and that these estimates are each = x consistent. The classifier x)} gt (x) = arg (x arg max{ηtk ( k
(where ties are broken in favour of the smaller index) is consistent for the corresponding multiclass classification problem. Proposition 4 allows us to reduce the consistency of the multiclass classifier to the problem of proving the consistenc consis tency y of several several two two class posterior estimates. estimates. Given a set of classes {1, . . . , c} we can re-assign the Y )) → ( X, I {Y Y = k }) for any labels using the map (X, (X, Y (X, k ∈ {1, . . . , c} in order to get a two class problem where P (Y Y = 1 | X = x)) in this new problem is equal to η = x to η k (x) in the original multiclass problem. Thus to prove consistency of the multiclass classifier it is enough to show that each of these two class posteriors is consistent. To this end we make use of the following theorem from Defrom Devroye et al. ( al. (1996 1996). ). Theore The orem m 5. Consider a partitio partitioning ning classific classification ation
of η (x) = ru rule le whic which h bu buil ilds ds a pre predict dictio ion n ηt (x) of P (Y Y = 1 | X = x)) by averaging the labels in each cell = x
of the partiti artition. on. If the lab labels els of the voting voting points oints do not influence the structure of the partition then E [|ηt (x) −
η (x)|] → 0
provided that 1. diam(A diam(At (X )))) → 0 in probability,
6. Experiments In this section we demonstrate some empirical results on simple problems in order to illustrate the properties of our algorithm. We also provide a comparison to an existing online random forest algorithm. Following the review process we plan to release code to reproduce all of the experiments in this section.
2. N e (At (X )))) → ∞ in probability. F
0
.
7
0
o
r
e
s
t
a
n
d
t
r
e
e
a
c
c
u
r
a
c
y
Proof. See Theorem 6.1 in Devroye 1996)). in Devroye et al. ( al. (1996 0
Here A t (X ) refers to the cell of the tree partition conHere A taining a random test point X point X ,, and diam(A diam(A) indicates A. the diameter of set A set . The diameter is defined as the maximum distance between any two points falling in A,
0
.
.
6
5
6
0
y
c
0
.
5
5
a
r
u
c
0
.
5
0
c
A
0
.
4
5
T
diam(A) = su diam(A sup p ||x − y || .
F
0
.
4
0
The quantity N quantity N e (At (X )) )) is the number of points con X . tributing to the estimation of the posterior at X .
B
.
3
5
e
e
r
s
e
s
t
x,y∈A 0
r
o
a
y
e
s
4 2
3
1 1
0
1
0
0
D
a
t
a
S
i
z
e
Figure 3.
This theorem The places two requirements thethe cells of the partition. first condition ensureson that cells are sufficiently small that small details of the posterior distribution can be represented. The second condition requires that the cells be large enough that we are able to obtain high quality estimates of the posterior probability in each cell.
forest them. trees it av average eragess Prediction on a simpl simpleeaccuracy mixture of of the Gaussians Gauss iansand problem. proble The horizontal line shows the accuracy of the Bayes classifier on this problem. problem. We see that the accuracy accuracy of the fore forest st consistently dominates the expected accuracy of the trees. The forest in this example contains 100 trees. Error regions show one standard deviation computed over 10 runs.
The leaf splitting mechanism described in Section Section 4.3 ensures that the second condition of Theorem 5 Theorem 5 is is satisfied. How Howeve ever, r, showing showing that our algor algorithm ithm satisfies satisfies the first condition requires significantly significantly more work. The chief difficulty lies in showing that every leaf of the tree will be split infinitely infinitely often in probabilit probability y. Once this claim is established a relatively straightforward
6.1. Advantage of a Forest
calculation the expected each dimension of ashows leaf isthat reduced each time size it is of split.
Our first experiment demonstrates that although the individual individ ual trees trees are consisten consistentt classifiers, classifiers, empirically empirically the perform performanc ancee of the for forest est is sig signifi nifican cantly tly better better than each of the trees for problems with finite data. We demonstrate this on a synthetic five class mixture of Gaussians problem with significant class overlap and variation in prior weights.
So far we have described the approach to proving consistency of our algorithm with an unbounded fringe. If the tree is small (i.e. never has more leafs than the maximum fringe size) then the analysis is unchanged. However, since our trees are required to grow to unbounded size this is not possible. To handle this case we derive an upper bound on the time required for an inacti ina ctive ve leaf to enter enter the fringe. fringe. Onc Oncee the leaf it remains there until it is split and the analysis from the unbounded fringe case applies.
From Figure 3 Figure 3 it it is clear that the forest converges much more quickly than the individual trees. Result profiles of this kind are common in the boosting and random forests literature; however, in practice one often uses inconsistent base classifiers in the ensemble (e.g. boosting with decision stumps or random forests where the trees are grown to full size). This experiment demonstrates that although our base classifiers provably converge, empirically there is still a benefit from averaging in finite time.
These details are somewhat technical, so we refer the for more information, interested reader to Appendix B Appendix B for
6.2. Growing leaves
as well as the proofs of the propositions stated in this section.
Our next experiment experiment demonstra demonstrates tes the importance importance of the condition that α(d) → ∞, i.e. having the num-
Figure 4. Excess error above the Bayes risk for a simple
Figure 5. Comparison between offline random forests and
synthetic problem. The solid line shows the excess error for a forest where each tree is built to full depth. The dashed line shows a forest where each tree requires 2d examples in a leaf at level d in order to split. Both forests contain 100 trees.
our online online algorith algorithm m on the US USPS PS data set. The online online forestt uses 10 passe fores passess through the data set. The third line is our implementation of the algorithm from Saffari from Saffari et al. (2009); 2009); the performance performance shown here is identica identicall to what they report. report. Erro Errorr regions show one standar standard d deviation computed over 10 runs.
6.3. Comparison to Offline
ber of data data poin points ts in each each leaf leaf gro grow w ov over er time. time. We demonstra demo nstrate te this using a synthetic synthetic two class distri distri-bution butio n specifically specifically designed to exhibit exhibit probl problems ems when α(d) does not grow. x) is uniIn the distrib distributi ution on we constr construct uct,, P (X = x) 2 R , and and the the pos poste teri rior or form form on the the un unit it squa square re in P (Y Y = 1 | X = x ) = 0.5001 for all x. Fig = x) Figur uree 4 shows the excess error of two forests trained on several data sets of different sizes sampled from this distribution. In one of the forests the trees are grown to full depth, while in the other we force the size of the leafs to increase with their depth in the tree. As can be seen in Figure 4 Figure 4,, buildin buildingg trees to full depth prevents the forest from making progress towards the Bayes error over a huge range of data set sizes, whereas the forest composed of trees with growing leafs steadily decreases its excess error. Admittedly,, this scenario is quite artificial, Admittedly artificial, and it can be difficult to find real problems where the difference is so pr pron onou ounc nced ed.. It is still still an open open ques questi tion on as to whether a forest can be made consistent by averaging over an infinite number of trees of full depth (although (2004 2004)) and Biau and Biau ( (2012 2012)) for results in this see Breiman see Breiman ( direction). The purpose of this example is to show that in the common scenario where the number of trees is a fixed parameter of the algorithm, having leafs that grow over time is important.
In our third experiment, experiment, we demonstra demonstrate te that our online algorithm is able to achieve similar performance to an offline offline implem implemen entat tation ion of random random for forest estss and also compare to an existing online random forests algorithm on a small non-synthetic problem. In particular, we demonstrate this on the USPS data 2011). set from the LibSVM repository repository (Chang ( Chang & Lin, Lin, 2011). We have chosen the USPS data for this experiment because it allows us to compare our results directly to those of Saffari Saffari et al. al. (2009 2009), ), whose algorithm is very similarr to our own. In the interest simila interest of comparability comparability we also use a forest of 100 trees and set the minimum information gain threshold (τ (τ in our model) to 0.1. We show results from both online algorithms with 10 passes through the data. Figure 5 Figure 5 shows shows that we are able to achieve performance very similar to the offline random forest on the full data. The performance performance we achieve achieve is identical identical to the 2009)) on this performance reported by by Saffari et al. (2009 data set. 6.4. Kinect application
For our final experiment we evaluate our online random forest algorithm on the challenging computer vision sion pro proble blem m of predic predictin tingg hu human man body par partt labels labels from from a depth depth image. image. Our procedur proceduree closel closely y fol follo lows ws the work of Shotton Shotton et al. ( al. (2011 2011)) which is used in the commercially commercia lly successful successful Kinect system. Applying Applying the
Figure 7. Comparison of our online algorithm with Saffari
Figure 6. Left: Depth, ground truth body parts and predicted body parts. Right: A candidate feature specified by two offsets.
et al. ( al. (2009 2009)) on the kinect application; Our algorithm does significantly better with less memory.
same approach as Shotton et al. (2011), 2011), our onlin onlinee classifier predicts the body part label of a single pixel P P in a de dept pth h image. image. To predic predictt all all the the label labelss of a depth image, the classifier is applied to every pixel in
τ ). (m) and and a mi minim nimum um in info form rmat atio ion n gain gain of 0. 0.01 01 (τ ). al. (2009 2009)) we set the number of sample For Saffari or Saffari et al. points required to split to 10 and for our own algorithm we set set α(d) = 10 · (1 (1..01d ) and and β (d) = 4 · α(d).
parrallel. For our dataset, we generate pairs of 640x480 resolution depth and body part images by rendering random poses pos es fro from m the the CMU CMU moc mocap ap dat datas aset et.. The The 19 body parts and one background class are represented by 20 unique color identifiers in the body part image. Figure 6 (left) visualizes the raw depth image, ground truth body part labels and body parts predicted predicted by our classifier for one pose. During training, we sample 50 pixels without replacement replacement for each body b ody part class from each pose; thus, producing 1000 data points for each depth image. image. During testing testing we evaluate evaluate the prediction accuracy accuracy of all non backgrou background nd pixels as this provides a more informative accuracy metric since most
With Wit h thi this s parame par settin tinggstatistics each each activ actwhich ivee leaf learequires f stores stores · 10 · 2000 · ameter , 000 20 2 =ter 400set 400, 1.6MB of memory. memory. By limiting the fringe to 1000 active leaves our algorithm requires 1.6GB of memory for leaf statistics. To limit the maximum memory used by 2009)) we set the maximum depth to 8 Saffari et al. (2009 which uses up to 25 · 2 8 = 6400 active leaves which requires up to 10GB of memory for leaf statistics.
of thect. pixels are relatively easy to predict. predi For are thisbackground experiment experimentand we use a strea stream m of 1000 poses for training and 500 poses for testing.
active set.
932 933 934
In this experiment we construct a forest of 25 trees with 2000 candidate offsets (λ (λ), 10 can candid didate ate split splitss
Each node of each decision tree computes the depth differe diff erence nce betwe between en tw twoo pixels pixels des descri cribed bed by two two offP (the pixel sets from P pixel being classified). classified). At training training time, candidate pairs of offsets are sampled from a 2dimensional Gaussian distributions with variance 75.0. P to The offsets are scaled by the depth of the pixel P 6 (right) viproduce depth invariant invariant features. Figure Figure 6 sualizes a candidate feature for the pixel in the green box.. The resultin box resultingg fea featur turee value alue is the dept depth h diff differerence between the pixel in the red box and the pixel in the white box.
shows that our algorithm algorithm achieve achievess signifisignifiFigure 7 shows cantly can tly better accuracy accuracy while requiring less memory memory.. However, our algorithm does not do as well when seeing a small number number of data points. points. This This is lik likely ely a result of separating data points into structure and estimation streams and not including all leaves in the
7. Discussion and Future Work In this paper we described an algorithm for building online random forests and showed that our algorithm is consistent. To the best of our knowledge this is the first consistency result for online random forests. The theory guides certain choices made when designing our algorithm, notably that it is necessary for the leafs leafs in eac each h tree tree to inc increa rease se in siz sizee over over time. time. Our experiments on simple problems confirm that this requirement is important. Growing trees online in the obvious way requires large amoun amo unts ts of memory memory,, sin since ce the tre trees es must must be grown grown breadth first and each leaf must store are large num-
ber of statistics statistics related related to its potential potential child children. ren. We incorporated a memory management technique from Domingos & Hulten ( 2000)) in order to limit the numHulten (2000 ber of leafs in the fringe of the tree. This refinemen refinementt is important, since it enables our algorithm to grow large trees. trees. The analysis analysis shows that our algorithm is still consistent with this refinement. Finally,, our curren Finally currentt algori algorithm thm is restri restricte cted d to axi axiss aligned alig ned splits. splits. Man Many y implemen implementat tation ionss of rand random om forests use more elaborate split shapes, such as random linear or quadratic quadratic combinatio combinations ns of features. These strategies can be highly effective in practice, especially in sparse sparse or high dimensional dimensional settings. settings. Under Understand standing ing how to maintain consistency in these settings is another potentially interesting direction of inquiry.
References H. Abdulsalam. Streaming Random Forests . PhD thes thesis, is, Queens University, 2008. G. Biau. Analysis of a Random Forests model. JMLR, JMLR, 13 (April):1063–1095, 2012. G. Biau, L. Devroye, and G. Lugosi. Consistency of random forests and other averaging classifiers. JMLR, JMLR, 9:2015– 2033, 2008. A. Bifet, G. Holmes, Holmes, and B. Pfahring Pfahringer. er. MOA: MOA: Massiv Massivee Online Analysis, a framework for stream classification and clustering. In Workshop In Workshop on Applications of Pattern Analysis , pp. 3–16, 2010. A. Bifet, E. Frank, G. Holmes, and B. Pfahringer. Ensembles of Restricted Hoeffding Trees. ACM Transactions on Intelligent Systems and Tec Technolo hnology gy , 3(2):1–20, February 2012. A. Bifet, Bifet, G. Holmes, Holmes, and B. Pfa Pfahri hringe nger. r. Ne New w ensem ensemble ble methods meth ods for evolving evolving data streams. streams. In In ACM ACM SIGKDD Intl. Conference on Knowledge Discovery and Data Mining , 2009. A. Bosch, A. Zisserman, Zisserman, and X. Munoz. Munoz. Image classificaclassification tion using using rando random m for forest estss and fern ferns. s. In In International International Conference on Computer Vision , pp. 1–8, 2007. L. Brei Breiman. man. Rando Random m forest forests. s. Machine Le Learning arning , 45(1): 5–32, 2001.
USA, 1996. P. Dom Doming ingos os and G. Hult Hulten. en. Min Mining ing high high-spe -speed ed data streams. In International In International Conference Conference on Knowledg Knowledgee Discovery and Data Mining , pp. 71–80. ACM, 2000. J. Gama, P. Meda Medas, s, and P. Rodrigues. Rodrigues. Lear Learning ning decisi decision on treess from dynamic data strea tree streams. ms. In In ACM ACM symposium on Applied computing , SAC ’05, pp. 573–577, New York, NY, USA, 2005. ACM. T. Hastie, R. Tibshirani, and J. Friedman. The Elements of Statistical Learning . Springer, 10 edition, 2013. H. Ishwaran Ishwaran and U. Kogalur. Cons Consiste istency ncy of random random survival forests. Statistics forests. Statistics and Probability Letters , 80:1056– 80:1056– 1064, 2010. Y. Lin and Y. Jeon. Random forests and adaptive nearest neighbors. Technical Report 1055, University of Wisconsin, 2002. N. Meinshau Meinshausen. sen. Quantile Quantile regre regression ssion forest forests. s. JMLR, JMLR, 7: 983–999, 2006. N. Oza and S. Rus Russel sel.. Online Online Bag Baggin ging g and Boos Boostin ting. g. In Artificial Intelligence and Statistics , volume 3, 2001. A. Prasad, L. Iverson, Iverson, and A. Liaw. New Newer er Classification Classification and Regression Tree Technique Techniques: s: Bagging and Random Forests for Ecological Prediction. Ecosystems , 9(2):181– 199, March 2006. ISSN 1432-98 1432-9840. 40.
L. Breima Breiman. n. Consi Consistenc stency y for a Simpl Simplee Model of Random Random Forest orests. s. Tech echnica nicall report, report, Univ Universi ersity ty of Calif California ornia at Berkeley, 2004.
A. Saffa Saffari ri,, C. Leis Leistn tner er,, J. Sa San ntn tner er,, M. Go Gode dec, c, and and H. Bisch Bischof. of. OnOn-lin linee rand random om for forest ests. s. In In International International Confer Con feren encce on Comput Computer er Vision Vision Wo Works rkshop hopss (IC (ICCV CV Workshops),, pp. 1393–1400. IEEE, 2009. Workshops)
L. Breiman, J. Friedman, C. Stone, and R. Olshen. Classification and Regression Trees . CRC CRC Press LLC LLC,, Boca Raton, Florida, 1984.
R. Schapire and Y. Freund. Boosting: Freund. Boosting: Foundations and Algorithms . MIT Press, Cambridge, Massachusetts, Massachusetts, 2012.
C. Chang and C. Lin. LIBS LIBSVM: VM: A libra library ry for support support vector machines. ACM machines. ACM Transactions on Intelligent Systems and Technology , 2:27:1–27:27, 2011.
J. Shotton, A. Fitzgibbon, M. Cook, T. Sharp, M. Finocchi chio, o, R. Moore, A. Kipm Kipman, an, and A. Blake. Real Real-tim -timee human pose recognition in parts from single depth images. CVPR, CVPR, pp. 1297–1304, 2011.
G. Cormode. Sketch techniques for approximate query pro-
V. Svetnik, A. Liaw, C. Tong, J. Culberson, R. Sheridan,
cessing. Synposes sesms, for Wavelets Approximate Approximate Pro Processi cessing: ng: Samples, Synpo Histogra Histograms, and Query Sketches, Found Foundaations and Trends in Databases , 2011.
and B. Feust Feuston. on. Ran Random dom fore forest: st: a classi classifica ficatio tion n and regression tool for compound classification and QSAR modeling. Journal of Chemical Information and Computer Scienc Sciences es , 43(6):1947–58, 2003.
G. Cormode and S. Muthukris Muthukrishnan. hnan. An impro improved ved dat data a stream summary: the count-min sketch sketch and its applications. Journal of Algorithms , 55(1):58–75, April 2005. A. Crimini Criminisi, si, J. Shott Shotton, on, and E. Kon Konuk ukogl oglu. u. De Decis cision ion forests: fores ts: A unifie unified d framewor framework k for classific classification ation,, regresregression, density density estimation, estimation, manifold manifold learning learning and semisupervised learning. Foundations and Trends in Computer Graphics and Vision , 7(2-3):81–227, 2011. D. Cutler, Cutler, T. Edwards Edwards,, and K. Bea Beard. rd. Ran Random dom fore forests sts for classificat classification ion in ecology. ecology. Ecology , 88(11):2783– 88(11):2783–92, 92, November 2007.
Devroye, L. Gy¨ o orfi, rfi, and G.. Lugosi. A Probabilistic The1152 of Pattern Recognition Springer-Verlag, Springer-V erlag, New York, 1153 L. ory 1154
A. Algorithm pseudo-code Candidate split dimension A dime dimens nsio ion n alon alongg whic which h a split split may be made made..
Ea Eacch le leaf af se sele lect ctss mi min( n(11 +
Poisson(λ), D) of these when it is created. Poisson(λ Candidate split point One of the first m first m structure points to arrive in a leaf. Candidate split A combination of a candidate split dimension and a position along that dimension to split.
These are formed formed by projecting each candidate split point into each candidate candidate split dimension. dimension. Candidate children Each Each candidate split in a leaf induces induces two candidate candidate children children for that leaf. These are also
referred to as the left and right child of that split.
A.. A,, and Y N e (A) is a count of estimation estimation points points in the cell cell A and Y e (A) is the histogram of labels of these points in A A.. A,, and Y N s (A) is a count of structure structure point point in the cell cell A and Y s (A) is the histogram of labels of these points in A Algorithm 1 BuildTree Require: Initially Initially the tree has exact exactly ly one leaf (TreeRoo (TreeRoot) t) which cover coverss the whole space Require: The dimensionality of the input, D τ .. input, D.. Parameters λ Parameters λ,, m and τ
SelectCandidateSplitDimensions(TreeRoot, min(1 + Poisson(λ SelectCandidateSplitDimensions(TreeRoot, Poisson(λ), D)) for t t = = 1 . . . do Receive (X (X t , Y t , I t ) from the environment At ← leaf containing X containing X t if I = estimation then t At , (X t , Y t )) UpdateEstimationStatistics(A UpdateEstimationStatistics( At ) do for all S ∈ CandidateSplits( CandidateSplits(A S ) do for all A ∈ CandidateChildren( CandidateChildren(S if X t ∈ A then A, (X t , Y t )) UpdateEstimationStatistics(A UpdateEstimationStatistics( end if end for end for else if I t = structure then than m candidate split points then if At has fewer than m At ) do for all d ∈ CandidateSplitDimensions( CandidateSplitDimensions(A
CreateCandidateSplit(At , d, πd X t ) CreateCandidateSplit(A end for end if for all S ∈ CandidateSplits( At ) do CandidateSplits(A for all A ∈ CandidateChildren( S ) do CandidateChildren(S if X t ∈ A then
UpdateStructuralStatistics(A, (X t , Y t )) UpdateStructuralStatistics(A end if end for end for if CanSplit(A CanSplit(At ) then if ShouldSplit(A ShouldSplit(At ) then
At ) Split(A Split( else if MustSplit(A MustSplit(At ) then
1320 Algorithm 2 Split 1321 Require: A leaf A A 1322 S ← ← BestSplit( A) BestSplit(A 1323 A ← LeftChild( A) LeftChild(A 1324 A , SelectCandidateSplitDimensions(A SelectCandidateSplitDimensions( 1325 λ), D)) Poisson(λ Poisson( 1326 A ← RightChild( A) RightChild(A 1327 A , SelectCandidateSplitDimensions(A SelectCandidateSplitDimensions(
Algorithm 5 MustSplit Require: A leaf A A
min(1
min(1
λ) ,, A D)) 1328 Poisson(λ Poisson( 1329 return A 1330 1331 1332 Algorithm 3 CanSplit 1333 Require: A leaf A A 1334 d ← Depth( A) Depth(A 1335 for all S ∈ CandidateSplits( A) do CandidateSplits(A 1336 if SplitIsValid(A S )) then SplitIsValid(A, S 1337 return true 1338 end if 1339 end for 1340 return false 1341 1342 1343 Algorithm 4 SplitIsValid A 1344 Require: A leaf A Require: S A split split S 1345 d ← Depth( A) Depth(A 1346 A ← LeftChild( S ) LeftChild(S 1347 A ← S ) RightChild(S RightChild( 1348 e α (d) α (d) and N and N e (A ) ≥ α( return N (A ) ≥ α( 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374
+
+
d ← Depth( A) Depth(A e return N (A) ≥ β (d) Algorithm 6 ShouldSplit A Require: A leaf A A) do for all S ∈ CandidateSplits( CandidateSplits(A S ) > τ then if InformationGain( InformationGain(S A, S S )) then if SplitIsValid( SplitIsValid(A return true end if end if end for return false Algorithm 7 BestSplit Require: A leaf A A Require: At least one valid candidate split exists for
A best split ← none for all S ∈ CandidateSplits(A) do if InformationGain( A, S ) > InformationGain( A, InformationGain(A InformationGain(A best split) then A, S S )) then if SplitIsValid( SplitIsValid(A best split ← S end if end if end for return best split Algorithm 8 InformationGain Require: A leaf A A Require: A split S split S
A ← LeftChild( S ) LeftChild(S A ← RightChild( S ) RightChild(S s
return Entropy( Y s (A))− N Entropy(Y s (A ))− Entropy(Y A)) Entropy(Y N ((A s
N s (A ) Entropy(Y s (A )) N s (A) Entropy(Y
Algorithm 9 UpdateEstimationStatistics A Require: A leaf A Require: A point (X, (X, Y Y ))
N e (A) ← N e (A) + 1 Y e (A) ← Y e (A) + Y Algorithm 10 UpdateStructuralStatistics Require: A leaf A A Require: A point (X, Y )) (X, Y
A will be reserved for subsets of RD , and unless otherwise indicated it can be assumed that A denotes a cell of the tree partition. We will ofte often n be inte intereste rested d in the cell of the tree partiti partition on containing containing a particular particular point, point, A (x) changes as well, which we denote denote A(x). Since the partit partition ion chang changes es over time, and theref therefore ore the shape of A( we use a subscript to disambiguate: At (x) is the cell of the partition containing containing x at time time t. Cells Cells in the tree tree partition have a lifetime which begins when they are created as a candidate child to an existing leaf and ends that τ when they are themselves split into two children. When referring to a point X point X τ ∈ A t (x) it is understood that τ A t (x). is restricted to the lifetime of A We treat cells of the tree partition and leafs of the tree defining it interchangeably, denoting both with an appropriately decorated A decorated A.. N generally N generally refers refers to the number number of points points of some type in some int interv erval al of time. time. The various various decorations decorations the N receive N receivess specify which particular particular type of point or inte interv rval al of time is being b eing considered. considered. A superscript superscript always always Twoo speci special al types types,, e and s, are used to denote denotes type, so N k refers to a count of points of type k. Tw k estimation estim ation and structure structure points, respec respective tively ly.. Pairs Pairs of subsc subscripts ripts are used to denote time intervals, intervals, so N a,b denotes the number of points of type k type k which appear during the time interval [a, [a, b]. We also use N use N as as a function e (A) refers to the number of whose argument is a subset of RD in order to restrict the counting spatially: N a,b estimation points which fall in the set A during the time interval [a, [ a, b]. We make use of one additional additional varian variantt k N as a function when its argument is a cell in the partition: when we write N (At (x)), without subscripts on of N as N , N , the interval of time we count over is understood to be the lifetime of the cell A cell A t (x). B.2. Preliminaries Lemma Lem ma 6. Suppose we partition a stream of data into c parts by assigning each point point (X t , Y t ) to part part I t ∈
{1, . . . , c} with fixed probability pk , meaning that b k N a,b =
I {I t = k = k }
.
(1)
t=a
k → ∞ for all k ∈ { , . . . , c} as b Then with probability 1, 1, N a,b as b − a → ∞. 1
Proof. Note that P (I t = 1) second Borel-C Borel-Can antel telli li 1) = p1 and these events are independent for each t. By the second lemma, lemm a, the probabilit probability y that the events events in this sequence occur infinitely infinitely often is 1. The cases for I for I t ∈ {2, . . . , c} are similar. Lemma Lem ma 7. Let X t be a sequence of iid random variables with distribution µ, let A be a fixed set such that
µ(A) > > 0 0 and let {I t } be a fixed partitioning sequence. Then the random variable k N a,b (A) =
I {X t ∈ A }
a≤t≤b:I t =k k and µ( µ (A). In particular, is Binomial with parameters N a,b P
µ(A) k k N a,b N a,b (A) ≤ 2
µ(A)2 k N a,b ≤ exp − 2
k which goes to 0 as b − a → ∞, where N a,b is the deterministic quantity defined as in Equation 1. 1 . k Proof. N a,b (A) is a sum of iid indicato indicatorr random random varia variable bless so it is Binomi Binomial. al. It has the specified specified paramet parameters ers k over N a,b elements elements
because it is a sum Hoeffding’s inequality we have that
A ) = µ(A). and P (X t ∈ A)
k (A) Moreo Moreove ver, r, E N a,b
k = µ(A)N a,b so by
k k k k k k . N a,b (µ(A) − ) ≤ exp −22 N a,b (A) ≤ N a,b = P N a,b (A) − N a,b (A) ≤ E N a,b
1540 B.3. Proof of Proposition Proposition 2 1541 denote the Ba Baye yess classi classifier fier.. Con Consis sisten tency cy of {gt } is equiv equivale alent nt to sa sayin yingg that that E [L(gt )] = 1542 Proof. Let g (x) denote ∗ P (gt (X, Z ) P (gt (X, Z ) P (g (X ) Y Y ) → L Y | X x x) ≥ Y | X x x) x ∈ RD , consis= ) . In fact, fac t, since sinc e = = = ) = = = ) for all all 1543 for µ-almost -almost all x all x,, 1544 tency of {{ gt } means that for µ 1545 x) → P (g(X ) x)) = 1 − max{η k (x)} P (gt (X, Z ) = Y | X = x) = Y | X = x k 1546 1547 Define the following two sets of indices 1548 1549 G = { k | η k (x) = max{η k (x)}} , 1550 k k 1551 B = { k | η (x) < max < max{η k (x)}} . k 1552 1553 Then 1554 1555 P (gt (X, Z ) x)) = P (gt (X, Z ) = k | X = x ) P (Y = k |X = x x)) = Y | X = x = x) 1556 k 1557 ≤ (1 − max{η k (x)}) P (gt (X, Z ) = k | X = x)) + P (gt (X, Z ) = k x)) , = x = k | X = = x 1558 k k ∈G k ∈B 1559 1560 (M ) However, r, using using Z M to which means it suffices to show that P gt (X, Z M ) = k | X = x → 0 for all k ∈ B . Howeve 1561 M (possibly Z , for all k B , denote M (possibly dependent) copies of Z , all k ∈ B, 1562 denote
Proof. The sequence in question is uniformly integrable, so it is sufficient to show that E [P (gt (X,Z,I ) = Y | I ))]] → ∗ L implies the result, where the expectation is taken over the random selection of training set. We can write Y ) = E [P (gt (X,Z,I ) P (gt (X,Z,I ) = Y | I )] )] = Y ) =
P (gt (X,Z,I ) = Y | I ) ν (I ) +
P (gt (X,Z,I ) = Y | I ) ν (I )
I c
I
By assumption ν assumption ν (( I c ) = 0, so we have lim
[0, 1], the dominated convergence theorem allows us to exchange 1650 Since probabilities are bounded in the interval [0, 1651 the integral and the limit, 1652 1653 = lim P (gt (X,Z,I ) = Y | I ) ν (I ) 1654 I t→∞ 1655 1656 and by assumption the conditional risk converges to the Bayes risk for all I ∈ I , so 1657
= L∗ which proves the claim. B.5. Proof of Proposition Proposition 4
Proof. By definition, the rule g(x) = arg arg max{η k (x)} k
(where ties are broken in favour of smaller k ) achieves the Bayes risk. In the case where all the η k (x) are equal there is nothing to prove, since all choices have the same probability of error. Therefore, suppose there is at least one k one k such that η that η k (x) < η g(x) (x) and define m(x) = η
g (x)
k
k
(x) − max{η (x) | η (x) < η
g (x)
k
(x)}
g (x)
mt (x) = η t (x) − max{ηtk (x (x) | η k (x) < η g(x) (x)} k
The function m function m((x) ≥ 0 is the margin function which measures how much better the best choice is than the second > 0 then m t (x) > 0 g t (x). If m best choice, ignoring possible ties for best. The function m function m t (x) measures the margin of g gt (x) has the same probability of error as the Bayes classifier. C to The assumption above guarantees that there is some such that that m(x) > . Us Usin ingg C to denote the number of classes, by making t making t large we can satisfy P
η k is consistent. Thus since η since
/22 ≥ 1 − δ/C |ηtk (X (X ) − η k (X )| < /
t
C
P
|ηtk (X (X )
C
k
− η (X )| < /2 /2 ≥ 1 − K + +
k=1
P
|ηtk ( X ) − η k (X )| < / /22 ≥ 1 − δ (X
k=1
So with probability at least 1 − δ we we have g (X )
mt (X ) = η t − max{ηtk (X (X ) | η k (X ) < η g(X ) (X )} k
≥ (η ( η = η
g(X )
g (X )
− / /2) /22 | η k (X ) < η g(x) (X )} 2) − max{ηtk (X (X ) + / k
− max{η (X ) | η k (X ) < η g(X ) (X )} − k
k
m(X ) − = m( > 0
1702 1703 Since δ is g t converges in probability to the Bayes risk. Since δ is arbitrary this means that the risk of g 1704
Figure 8. This Figure shows the setting of Proposition 8 Proposition 8.. Conditioned on a partially built tree we select an arbitrary leaf
at depth d and an arbit arbitrary rary candid candidate ate split in that leaf. The proposition proposition shows that, assuming assuming no other split for A is selected, we can guarantee that the chosen candidate split will occur in bounded time with arbitrarily high probability.
B.6. Proof of Theorem 1
The proof of Theorem 1 Theorem 1 is built in several pieces. Proposition 8. Fix a pa partiti rtitioning oning sequenc sequence. e. Let Let t0 be a time at which a split occurs in a tree built using this
sequence, and let let gt denote denote the tree tree aft after er this split has been made. If A is one of the newly created cells in gt then we can guarantee that the cell A is split before time t > t0 with probability at least 1 − δ δ by by making t sufficiently large. 0
0
X has a Proof. Let that µ(A) > 0 with probability 1 since X Let d denote the depth of of A in the tree gt and note that 8.. By construction, if the following conditions hold: density. This situation is illustrated density illustrated in Figur Figuree 8 0
1. For some candidate candidate split in A in A,, the number of estimation points in both children is at least α α((d), 2. The number number of estimation estimation points in A in A is at least β least β ((d), then the algorithm must split A when the next structure structure point arrives. arrives. Thus in order to force a split we need the following sequence of events to occur: 1. A structure structure point must arrive arrive in A in A to create a candidate split point. 2. The above two two conditions conditions must be satis satisfied. fied. 3. Another Another structure structure point must arrive arrive in A to force a split. It is possible for a split to be made before these events occur, but assuming a split is not triggered by some other mechanism we can guarantee that this sequence of events will occur in bounded time with high probability. Suppose a split Suppose split is not triggere triggered d by a diff differe erent nt mechan mechanism ism.. Define Define E 0 to be an event that occurs at t0 with numbered even events ts occur. Each Each of these probability 1, and let let E 1 ≤ E 2 ≤ E 3 be the times at which the above numbered events requires the previous one to have occurred and moreover, the sequence has a Markov structure, so for t0 ≤ t 1 ≤ t 2 ≤ t 3 = t = t we we have P (E 1 ≤ t
∩ E 2 ≤ t ∩ E 3 ≤ t | E 0 = t = t 0 ) ≥ P (E 1 ≤ t 1 ∩ E 2 ≤ t 2 ∩ E 3 ≤ t 3 | E 0 = t = t 0 ) = t 0 ) P (E 2 ≤ t 2 | E 1 ≤ t 1 ) P (E 3 ≤ t 3 | E 2 ≤ t 2 ) = P (E 1 ≤ t 1 | E 0 = t ≥ P (E 1 ≤ t 1 | E 0 = t = t 2 ) . = t 1 ) P (E 3 ≤ t 3 | E 2 = t = t 0 ) P (E 2 ≤ t 2 | E 1 = t
We can rewrite the first and last term in more friendly notation as P (E 1 ≤ t 1
P (E 3 ≤ t 3 | E 2 = t = t 2 ) = P N ts2 ,t3 (A) ≥ 1
.
1867 1868 1869
Consistency of Online Random Forests
1870 E 0 E 1 E 2 E 3 t 1871 t3 − t2 t0 1872 t2 − t1 t1 − t0 1873 1874 and 9 9.. The indicated intervals are 1875 Figure 9. This Figure diagrams the structure of the argument used in Propositions 8 and show regions where the next event must occur with high probability. Each of these interv intervals als is finite, so their sum is also 1876 1877 finite. We find an interval which contains all of the events with high probability by summing the lengths of the intervals
Lemma 7 Lemma 7 allows allows us to lower bound both of these probabilities by 1 − for any any > 0 by making t making t 1 − t0 and t 3 − t2 large enough that N ts0 ,t1
2 ≥ max 1, µ(A)−1 log µ(A)
N ts2 ,t3
2 ≥ max 1, µ(A)−1 log µ(A)
1
and 1
> 0 with probability 1, and β α((d) > 0 and µ and β (d) ≥ α and µ((A ) > 0 respectively. To bound the centre term, recall that µ that µ((A ) > 0 so P (E 2 ≤ t 2
| E 1 = t 1 ) ≥ P N te ,t (A ) ≥ β (d) ∩ N te ,t (A ) ≥ β (d)
1
2
1
≥ P N te1 ,t2 (A ) ≥ β (d)
2
+ P N te ,t (A ) ≥ β (d) − 1 ,
1
2
making t 2 − t1 sufficiently large that and we can again use Lemma 7 Lemma 7 lower bound this by 1 − by making t N te1 ,t2
2 ≥ max β (d), min {µ(A ), µ(A )}−1 log min{µ(A ), µ(A )}
2
t is at least 1 − δ if Thus by setting setting = 1 − (1 − δ )1/3 can ensure that the probability of a split before time time t if we make t = t ( t3 − t2 ) ( t2 − t1 ) + (t ( t1 − t0 ) + (t = t 0 + (t sufficiently large. Propositio Propos ition n 9. Fix a pa partitio rtitioning ning sequ sequenc ence. e. Each cell in a tr tree ee built based based on this sequenc sequencee is split infinitely infinitely
often in probability. i.e for any x in the support of X , P (At (x) has
been split fewer than K K times ) → 0
as t → ∞ for all K . Proof. For an arbitrary point x X , let E point x in in the support of X , let E k denote the time at which the cell containing x containing x is is split for the the k th time, or infinity if the cell containing containing x is split fewer than k times (define (define E 0 = 0 with probability 1). Now define the following sequence: t = 0 0 ti = min{t | P (E i ≤ t | E i−1 = t = t i−1 ) ≥ 1 − }
1980 and set T Proposition 8 guarantees that each of the above t set T δ = t k . Proposition 8 above t i ’s exists and is finite. Compute, 1981 k 1982 P (E k ≤ T δ ) = P [E i ≤ T δ ] 1983 i=1 1984 k 1985 ≥ P [E i ≤ t i ] 1986 i=1 1987 k
≥ (1 − )k or any δ any δ > 0 we can choose T choose T δ to guarantee P (E k ≤ T δ ) ≥ where the last line follows from the choice of t of ti ’s. Thus ffor 1/k − δ = − − δ 1 by setting by setting = 1 (1 ) and applying the above process. We can make this guarantee for any k which t ) → 1 as t allows us to conclude that P (E k ≤ t) as t → ∞ for all k all k as required. partitio rtitioning ning seque sequence nce.. Let Let At (X ) denote the cell of gt (built based on the partitioning Proposition 10. Fix a pa t → ∞. sequence) containing the point X . X . Then diam(A )) → 0 in probability as t diam(At (X )) A t (x). It suffices to show that E [V t (x)] → 0 for all x Proof. Let V all x in the Let V t (x) be the size of the first dimension of A X . support of X . ∼ µ|A (x) for some 1 ≤ m ≤ m denote the samples from the structure stream that are used Let X 1 , . . . , Xm Let dth th coordinate, and Use π d to denote a projection onto the d to determine the candidate splits in the cell cell At (x). Use π without loss of generality, assume that V that V t = 1 and π and π 1 X i ∼ Uniform[0 Uniform[0,, 1]. Conditioned on the event that the first dimension is cut, the largest possible size of the first dimension of a child cell is bounded by
t
m
m
i=1
i=1
V ∗ = max(max π1 X i , 1 − min π1 X i ) . λ), D) and select that number of Recalll that we choose the number Recal number of candi candidate date dimens dimensions ions as min(1 + Pois Poisson( son(λ distinct dimensions distinct dimensions uniformly uniformly at rando random m to be candi candidates dates.. Define the following following events: events: E 1 = { There is exactly exactly one candidate dimensi dimension on} E 2 = { The first dimension is a candidate} V to denote the size of the first dimension of the child cell, Then using using V E [V
] ≤ E [I {(E 1 ∩ E 2 )c } + I {E 1 ∩ E 2 } V ∗ ] = P (E 1c ) + P (E 2c |E 1 ) P (E 1 ) + P (E 2 |E 1 ) P (E 1 ) E [V ∗ ] 1 1 = (1 − e−λ ) + (1 − )e−λ + e−λ E [V ∗ ] d d −λ −λ e e ∗ E [V ] + =1 − D D m e −λ e −λ m E max(max π1 X i , 1 − min π1 X i ) + =1 − i=1 i=1 D D e −λ e −λ 2m 2 m + 1 · + =1 − D 2m + 2 D
2090 Iterating this argument we have that after K after K splits splits the expect expected ed size of the first dimension dimension of the cell containing containing 2091 x is upper bounded by 2092 K 2093 e−λ 1− 2094 2D(m + 1) 2095 9 . 2096 so it suffices to have K → ∞ in probability, which we know to be the case from Proposition 9. 2097 partitioning ning seque sequenc nce. e. In any tree tree built built base based d on this sequenc sequence, e, N e (At (X )))) → ∞ in Proposition 11. Fix a partitio 2098 2099 probability.
X . Fix such an x Proof. It suffices to show that N all x in in the support of X . an x,, by Proposition Proposition 9 that N e (At (x)) → ∞ for all x 9 we we than K times times arbitrarily small for any K any K . Moreover, by construction can make the probability A probability At (x) is split fewer than K immediately after the K the K -th -th split is made the number of estimation points contributing to the prediction at x is K we have that P (N e (At (x)) < α(K )))) → 0 as at least least α(K ), ), and this number number can only increase. increase. Thus Thus for all K )) < t → ∞ as required. We are now ready to prove our main result. All the work has been done, it is simply a matter of assembling the pieces. Proof (of Theorem 1). 1 ). Fix a partitioning sequence. Conditioned on this sequence the consistency of each of the class posteriors follows from Theorem Theorem 5. The two required conditions where shown to hold in Propositions 10 and 11 and 11.. Consistency of the multiclass tree classifier then follows by applying Proposition 4. 4 . To remove the conditioning on the partitioning sequence, note that Lemma 6 shows that our tree generation mechanism mec hanism produces produces a partitionin partitioningg sequence with probab probabilit ility y 1. Apply Proposition Proposition 3 to get unconditional consistency of the multiclass tree. Proposition 2 Proposition 2 lifts consistency of the trees to consistency of the forest, establishing the desired result. B.7. Extension to a Fixed Size Fringe
Proving consistency Proving consistency is preserve preserved d with a fixed size fring fringee requir requires es more precise precise control control over the relationsh relationship ip e between the number of estimation points seen in an interval, N t ,t , and the total number of splits which have occurred in the tree, K tree, K .. The following two lemmas provide the control we need. 0
partitioning sequenc sequence. e. If K is K is the number of splits which have occurred at or before time t Lemma 12. Fix a partitioning then for all M > 0 P (K ≤ M M )) → 0
in probability as t → ∞. Proof. Denote the fringe at time t F t which has max size | F |, and the set of leafs at time t time t with with F time t as L t with size |Lt |. If || Lt | < | F | then there is no change from the unbounded fringe case, so we assume that | Lt | ≥ |F | so that for all t all t there are exactly | F | leafs in the fringe. A 1 ∈ F t for some t all t ≥ t 1 every δ > 0 there is a finite time t time t 1 such that for all t some t 0 then for every δ Suppose a leaf A 0
P (A1 has
t ) ≤ not been split before time t)
δ |F |
t = maxi ti A i ∈ F t we can choose t choose t i to satisfy the above bound. Set t = Now fix a time t time t 0 and δ and δ > 0. For each leaf A then the union bound gives 0
for any any > 0. partitioning sequenc sequence. e. If K is K is the number of splits which have occurred at or before time t Lemma 13. Fix a partitioning t → ∞. then for any tt 0 > 0 > 0,, K/N K /N te ,t → 0 as t 0
0
0
−1 so
K K = e e N t ,t N 0,t − N 0e,t 0
and since N since N 0e,t the notation.
0
−1 is
0
−1
N = N 0e,t to lighten fixed it is sufficient to show that K/N that K/N 0,t → 0. In the following we write N
T as the minimum value of N required N required to construct a tree with the same shape as T Define the cost of a tree T as as T .. α( d d d. The cost of the tree is governed by the function α function ( ) which gives the cost of splitting a leaf at level . The cost of a tree is found by summing the cost of each split required to build the tree. K splits Note that no tree on K splits is cheaper than a tree of max depth d = log2 (K ) with all levels full (except possibly the last, last, which may be partially full). full). This is simple to see, since since α(d) is an increasing function of of d, meaning it is never more expensive to add a node at a lower level than a higher one. Thus we assume wlog that the tree is full except possibly in the last level. When filling the the dth layer of the tree, each split requires at least 2α 2 α(d + 1) points because a split creates two d d+1 K in − 1] (the range of splits which fill up level new leafs at level d level d + 1. This This means means that ffor or K in the range [2 , 2 d), K can ), K can increase at a rate which is at most 1/ 1/2α(d + 1) with respect to N to N .. This This also tells us that filling filling the d d−1 dth level of the tree requires that N increase N increase by at least 2 α(d) = 2 · 2α(d) (filling the d the dth th level corresponds d−1 to splitting each of the 2 leafs on the d the d − 1th level at a cost of 2α 2α(d) each). This means that filling filling d levels of the tree requires at least d
N d =
2k α(k)
k=1
K is at most 2 d − 1 because that is the number of splits in a full binary tree of depth d d.. points. When N When N = N d , K is N . We know that the maximum The above argument gives a collection of linear upper bounds on K on K in in terms of N . d d+1 − 1) so for all d we can find that since growth rate is linear between (N ( N d , 2 − 1) and (N (N d+1 , 2 (2d+1 − 1) − (2d − 1) (N d+1 ) − (N d ) = we have that for N for N and d and d,,
2d+1 − 2d
d+1 k k=1 2 α(k)
K ≤ ≤
−
1 2d d +1 d k = 2 α(d + 1) = 2α(d + 1) k=1 2 α(k )
1 N + + C (d) 2α(d + 1)
C ((d) is given by where C where d
α(k ) 1 2k C (d) = 2 − 1 − 2 k=1 α(d + 1)
d
From this we have
K 1 1 1 ≤ 2d − 1 − + N 2α(d + 1) N 2
d
k=1
α(k ) 2k α(d + 1)
N ,, so if we choose d δ/22 and then pick N δ/22 2252 holds for all d all d and and N choose d to to make 1/α 1/α((d + 1) ≤ δ/ pick N such such that C that C (d)/N ≤ δ/ 2253 which δ for arbitrary δ we have K/N have K/N ≤ δ for arbitrary δ > 0 which proves the claim. 2254
Figure 10. Diagram of the bound in Lemma 13. 13 . The horizontal axis is the number of estimation points seen at time t and the vertical vertical axis is the num number ber of split splits. s. The first bend is the earliest earliest point at which the root of the tree could be split, which requires 2α(1) points to create 2 new leafs at level 1. Simil Similarly arly,, the second second bend is the point at which all leafs at level 1 have been split, each of which requires at least 2α(2) points to create a pair of leafs at level 2.
In order to show that our algorithm remains consistent with a fixed size fringe we must ensure that Proposition 8 Proposition 8 does not fail in this setting. Interpreted in the context of a finite fringe, Proposition 8 says that any cell in the fring fringe will be beadded split in time. time.inThis consistency y we need only show show that any inactive inactive pointe will to finite the fringe finitemeans time. that to ensure consistenc e (A) = 0, since µ( µ (A) > 0 > 0 by construction. If e(A) = 0 Remark 14. If s(A) = 0 for any leaf then we know that e( then P (g(X ) A ) = 0 which means that any subdivision of A has the same asymptotic probability of = Y | X ∈ A) error as leaving A in tact. Our rule never splits A and thus fails to satisfy the shrinking leaf condition, but our predictions are asymptotically the same as if we had divided A A into arbitrarily many pieces so this doesn’t matter. Proposition 15. Every leaf with s(A) > 0 > 0 will be added to the fringe in finite time with high probability.
Proof. Pick an arbitrary leaf A. A . We kno know w from Hoeffding’s Hoeffding’s inequalit inequality y that P ( p( pˆ(A) ≤ µ( µ (A)
− ) ≤ exp −2|A|2 ≤ exp −2α(d)2
and
) ≤ exp −2|A|2 ≤ exp −2α(d)2
P ( p( pˆ(A) ≥ µ( µ (A) +
A is a Now pick an arbitrary time t time t 0 and condition on everything before t 0 . For an arbitrary node node A ⊂ RD , if A A then we know that if { { U i }Dm child of A [0, 1] then i=1 are iid on [0,
E [µ(A
Dm
µ (A)E max(max( U i , 1 − U i )) )] ≤ µ( (max(U µ (A) = µ(
i=1
2Dm + 1 2Dm + 2
m candidate splits. So if A A K since there are at most D most D candidate dimensions and each one accumulates at most m candidate A then is any leaf created by K by K splits splits of A E
K
µ(A ) ≤ µ( µ (A)
2Dm + 1 2Dm + 2
K
Notice that since we have conditioned on the tree at t at t 0 so, E
A 0 which is in the tree at time t0 . We can use the same approach Pick an arbitrary leaf A approach to find a lower lower bound on sˆ(A0 ): P
s (A0 ) − sˆ(A0 ) ≤ s(
1 log 2|A0 |
+1 1 |L| 2K +
δ
≤
δ +1 1 |L| 2K +
pˆ(AK ) (≥ sˆ(AK )) fails to hold with probability at most δ 2−K |L|−1 we must choose choose k To ensure that sˆ(A0 ) ≥ p( t to make and t and s(A0 ) ≥ µ( µ (A)
2Dm + 1 2Dm + 2
K
1 log 2|AK |
+
+1 1 |L| 2K + δ
+
1 log 2|A0 |
+1 1 |L| 2K + δ
The first term goes to 0 as as K → ∞. We kno know w that |AK | ≥ α(K ) so the second term also goes to 0 provided K/α((K ) → 0, which we require. that K/α that K /|A0 | → 0. Recall that | A0 | = N any γ > 0 = N te ,t (A0 ) and for any γ The third term goes to 0 if K/ 0
P
N te ,t (A) ≤ N te ,t µ(A) − 0
0
1 log 2N te ,t 0
1 γ
≤ γ
From this we see it is sufficient to have K/N have K/N te ,t → 0 which we established in a lemma. 0
In summary, there are |L| leafs in the tree at time time t0 and each of them generates at most 2 K different different AK ’s. Union bounding over all these leafs and over the probability of of N te ,t (A0 ) growing sublinearly in N te ,t we have that, conditioned on the event that that A0 has not yet been split, A0 is the leaf with the highest value of ˆs with − γ in γ are probability at least 1 − δ − in finite time. Since δ Since δ and and γ are arbitrary we are done. 0