Online Random Forest

Published on April 2021 | Categories: Documents | Downloads: 0 | Comments: 0 | Views: 41
of x
Download PDF   Embed   Report

Comments

Content

 

000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054

Consistency of Online Random Forests

Abstract

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

055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 071 072 073 074 075 076 077 078 079 080 081 082 083 084 085 086 087 088 089 090 091 092 093 094 095 096 097 098 099 100 101 102 103 104 105 106 107 108 109

 

Consistency of Online Random Forests

110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164

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

165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219

 

Consistency of Online Random Forests

4. Online Random Forests with Stream Partitioning

220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242

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

243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274

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

275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329

 

Consistency of Online Random Forests

330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384

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

385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439

 

Consistency of Online Random Forests

440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494

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

495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549

 

Consistency of Online Random Forests

550  551 552  553  554 555  556  557  558  559  560  561 562  563  564 565  566  567  568  569  570  571 572 

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



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

605  606  607  608  609  610  611 612  613  614 615  616  617  618  619  620  621 622  623  624 625  626  627  628  629  630  631 632  633  634 635  636  637  638  639  640  641 642  643  644 645  646  647  648  649  650  651 652  653  654 655  656  657  658  659 

 

Consistency of Online Random Forests

660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714

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-

715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769

 

Consistency of Online Random Forests

770 771 772 773 774 775 776 777

Gap to Bayes Error

U

1

α(d) =

1

α(d) =

2d

     r      o      r      r        E      s      s      e      c      x        E

793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824

S

P

S

 

.

 9

 

825 826 827 828 829 830 831 832

 

0

.

 8

 y

 c

 a

 r

0

.

 7

 u

 c

 c

 A

.

0

 6

.

O

f

O

n

3

10

10

4

5

10

10

6

0

.

f

l

i

n

e

 

 

 

 

 5

S

Bayes

 

 0

0

0

778 779 780 781 782 783 784 785 786 787 788 789 790 791 792

.

l

a

f

i

f

n

e

a

 

r

i

 



e

 

 

t



a

l

.



(

2

0

0

9

)

 

 

 4

 2

1

 3

 0

1

 0

Data Size D

a

t

a



S

i

z

e

 

 

 

 

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

833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879

 

K

0

.

0

.

0

n

e

c

t

 

 

 7

.

0

i

 8

Consistency of Online Random Forests

 6

.

 5

 y

 c

 a

 r

0

.

 4

 u

 c

 c

 A

0

.

0

.

0

0

 3

 2

.

 1

.

 0

880 881 882 883 884 885 886 887



 0

888 889 890 891 892 893 894 895 896 897 898 899 900 901 902

α 



S

a



)

f

=

f

1

a

r

  · 

0

i



e

(

t

 







 

a

 4

 2

1

935 936 937 938 939 940 941 942

0

l



.





(

2

0

0

9

)

 

 

 5



1





1

D

a

t

 0

a

1



S

i

z

e

 

 

 

 0

1



 

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).

903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931

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-

943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989

 

Consistency of Online Random Forests

990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012

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.

1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067

1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041

1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096

1042 1043 1044

1097 1098 1099

 

Consistency of Online Random Forests

1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151

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

1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209

 

Consistency of Online Random Forests

1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264

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

At ) Split(A Split( end if  end if  end if  end for

1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319

 

Consistency of Online Random Forests

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 

N s (A)  ←  N s (A) + 1 Y s (A)  ←  Y  s (A) + Y 

1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429

 

Consistency of Online Random Forests

1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481

B. Proof of Consistency B.1. A note on notation

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 −22 N a,b (A)  ≤  N a,b  =   P N a,b (A) − N a,b (A)  ≤  E N a,b

P







1482 1483 Setting    =   21 µ(A) gives the desired result. Setting  1484

 







1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539

 

Consistency of Online Random Forests

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

1595 1596 1597 1598 1599 1600 1601 1602

1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591

1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646











1592 1593 1594

P

    M 



(M ) gt   (x, Z M ) =  k

 =  P

j =1

M  I {gt (x, Z j ) =  k }  > max  >  max c =k



≤  P

I {gt (x, Z j ) =  k } ≥  1

j =1

 



I {gt (x, Z j ) =  c }

j =1

 

By Markov’s inequality,

  M 

≤  E

I {gt (x, Z j ) =  k }

j =1

 k )  →  0 =  M P (gt (x, Z ) =  k)

 

B.4. Proof of Proposition  Proposition   3

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



By assumption ν  assumption  ν (( I c ) = 0, so we have lim

t→∞

P (gt (X,Z,I )    Y  ) =  Y )

= tlim →∞

  I 

P (gt (X,Z,I )   =  Y   | I ) ν (I )

1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617

1647 1648 1649

 

Consistency of Online Random Forests

[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

 

1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701

=  L∗

 

ν (I )



=  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 )





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

1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759

 

Consistency of Online Random Forests

1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814

d 

A



A

A

A A

A

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

| E 0  = t  =  t 0 ) =   P N ts ,t (A)  ≥  1   , 0



1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866

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

1925 1926 1927 1928 1929 1930 1931 1932

1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892

1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947

for which we have individual bounds.

1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924

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 − }

1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979

 

Consistency of Online Random Forests

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

 

 

1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031

=

P

E i  ≤  t i |

   

i=1 k

=



[E j   ≤  t j ]

j<i

P (E i  ≤  t i

| E i−1  ≤  t i−1 )

P (E i  ≤  t i

| E i−1  =  t i−1 )



i=1 k



i=1

≥  (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





2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086

−λ

2032 2033 2034

=1 −   e 2D(m + 1)

2087 2088 2089

 

Consistency of Online Random Forests

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.





2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144

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

P (K   ≤ ≤

|F |  at time t time  t))  ≤  δ 

2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199

 

Consistency of Online Random Forests

2200 2201 2202 2203 2204 2205 2206 2207

δ   =   / M/ |F |  and apply the union bound again to get that for Iterate this argument   M/ |F |   times with   δ   sufficiently large t large  t

2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222

Proof.  First note that N  that  N te ,t  =  N 0e,t − N 0e,t

2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251

P (K   ≤ ≤  M   M ))  ≤  

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

2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309

 

Consistency of Online Random Forests

2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364

2365 2366 2367 2368 2369 2370 2371 2372

K  23 − 1 1 2α(3)

2

2 −1 C (2) (2)

1 2α(2)

1

2 −1 1 2α(1)

N 0e,t

0

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



 

µ(A )  ≤  µ(  µ (A)



2Dm + 1 2Dm + 2





Notice that since we have conditioned on the tree at t at  t 0   so, E

 p(  pˆ(AK )  =  E

 p(  pˆ(AK ) | µ(AK )  =  E µ(AK )

   E

  

2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419

 

Consistency of Online Random Forests

2420 And we can bound p  p( ˆ(AK ) with 2421 K  2422 2Dm + 1 K  P  p(  pˆ(A )  ≥  µ(  µ (A) +   ≤  exp −2|AK |2 2423 2Dm + 2 2424 +1 1 2425 Set (2K + |L|)−1 δ  =   = exp −2|AK |2  and invert the bound so we have 2426 2427 K  +1 1 |L|   δ    1 2K + 2Dm + 1 K  K  +1 1 |L| P  p δ   µ (A) 2Dm + 2  p( 2428 + 2|A |  log  ≤ 2K + ˆ(A )  ≥  µ( 2429





2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474

 





2475 2476 2477 2478 2479 2480 2481 2482





  









 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

0

2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close