Estimating the Algorithmic Variance of Randomized Ensembles via the Bootstrap
Miles E. Lopes
Introduction
Random forests and bagging are some of the most widely used prediction methods (Breiman 1996; Breiman 2001), and over the course of the past fifteen years, much progress has been made in analyzing their statistical performance (Bühlmann and Yu 2002; Hall and Samworth 2005; Biau, Devroye and Lugosi 2008; Biau 2012; Scornet, Biau and Vert 2015). However, from a computational perspective, relatively little is understood about the algorithmic convergence of these methods, and in practice, ad hoc criteria are generally used to assess this convergence.
To clarify the idea of algorithmic convergence, recall that when bagging and random forests are used for classification, a large collection of randomized classifiers is trained, and then new predictions are made by taking the plurality vote of the classifiers. If such a method is run several times on the same training data , the prediction error of the ensemble will vary with each run, due to the randomized training algorithm. As the ensemble size increases with held fixed, the random variable typically decreases and eventually stabilizes at a limiting value . In this way, an ensemble reaches algorithmic convergence when its prediction error nearly matches that of an infinite ensemble trained on the same data.
Meanwhile, with regard to computational cost, larger ensembles are more expensive to train, to store in memory, and to evaluate on unlabeled points. For this reason, it is desirable to have a quantitative guarantee that an ensemble of a given size will perform nearly as well as an infinite one. This type of guarantee also prevents wasted computation, and assures the user that extra classifiers are unlikely to yield much improvement in accuracy.
To measure algorithmic convergence, we propose a new bootstrap method for approximating the distribution as . Such an approximation allows the user to decide when the algorithmic fluctuations of around are negligible. If particular, if we refer to the algorithmic variance
as the variance of due only the training algorithm, then the parameter is a concrete measure of convergence that can be estimated via the bootstrap. In addition, the computational cost of the method turns out to be quite modest, by virtue of an extrapolation technique, as described in Section 4.
Although the bootstrap is an established approach to distributional approximation and variance estimation, our work applies the bootstrap in a relatively novel way. Namely, the method is based on “bootstrapping an algorithm”, rather than “bootstrapping data” — and in essence, we are applying an inferential method in order to serve a computational purpose. The opportunities for applying this perspective to other randomized algorithms can also be seen in the papers Byrd et al. 2012; Lopes, Wang and Mahoney 2017; Lopes, Wang and Mahoney 2018, which deal with stochastic gradient methods, as well as randomized versions of matrix multiplication and least-squares.
where is a volume measure, the symbol denotes the divergence of the vector field , and the symbol is a volume element on . In our analysis, it is necessary to adapt this result to a situation where the maps are non-smooth, the manifold is a non-smooth subset of Euclidean space, and the vector field is a non-smooth Gaussian process. Furthermore, applying a version of Stokes’ theorem to the right side of equation (1.1) leads to a particular linear functional of , which turns out to be the Hadamard derivative relevant to understanding . A more detailed explanation of this connection is given below equation (B.1) in Appendix B.
Among the references just mentioned, the ones that are most closely related to the current paper are Lopes 2016 and Cannings and Samworth 2017. These works derive theoretical upper bounds on or , where is the error rate on a particular class (cf. Section 4). The paper Lopes 2016 also proposes a method to estimate the unknown parameters in such bounds. In relation to these works, the current paper differs in two significant ways. First, we offer an approximation to the full distribution , and hence provide a direct estimate of algorithmic variance, rather than a bound. Second, the method proposed here is relevant to a wider range of problems, since it can handle any number of classes, whereas the analyses in Lopes 2016 and Cannings and Samworth 2017 are specialized to the binary setting. Moreover, the theoretical analysis of the bootstrap approach is entirely different from the previous techniques used in deriving variance bounds.
Outside of the setting of randomized ensemble classifiers, the papers Sexton and Laake 2009; Arlot and Genuer 2014; Wager, Hastie and Efron 2014; Mentch and Hooker 2016; Scornet 2016a look at the algorithmic fluctuations of ensemble regression functions at a fixed test point.
2 Background and setup
We consider the general setting of a classification problem with classes. The set of training data is denoted , which is contained in a sample space . The feature space is arbitrary, and the space of labels has cardinality . An ensemble of classifiers is denoted by , with .
The key issue in studying the algorithmic convergence of bagging and random forests is randomization. In the method of bagging, randomization is introduced by generating random sets , each of size , via sampling with replacement from . For each , a classifier is trained on , with the same classification method being used each time. When each is trained with a decision tree method (such as CART (Breiman et al. 1984)), the random forests procedure extends bagging by adding a randomized feature selection rule (Breiman 2001).
It is helpful to note that the classifiers in bagging and random forests can be represented in a common way. Namely, there is a deterministic function, say , such that for any fixed , each classifier can be written as
where , is an i.i.d. sequence of random objects, independent of , that specify the “randomizing parameters” of the classifiers (cf. Breiman 2001). For instance, in the case of bagging, the object specifies the randomly chosen points in .
Beyond bagging and random forests, our proposed method will be generally applicable to ensembles that can be represented in the form (1.2), such as those in Ho 1998; Dietterich 2000; Bühlmann and Yu 2002. This representation should be viewed abstractly, and it is not necessary for the function or the objects to be explicitly constructed in practice. Some further examples include a recent ensemble method based on random projections (Cannings and Samworth 2017), as well as the voting Gibbs classifier (Ng and Jordan 2001), which is a Bayesian ensemble method based on posterior sampling. More generally, if the functions are i.i.d. conditionally on , then the ensemble can be represented in the form (1.2), as long as the classifiers lie in a standard Borel space (Kallenberg 2006, Lemma 3.22). Lastly, it is important to note that the representation (1.2) generally does not hold for classifiers generated by boosting methods (Schapire and Freund 2012), for which the analysis of algorithmic convergence is quite different.
Let denote the distribution of a test point in , drawn independently of and . Then, for a particular realization of the classifiers , trained with the given set , the prediction error rate is defined as
where . (Class-wise error rates , with will also be addressed in Section 4.1.) Here, it is crucial to note that is a random variable, since is a random function. Indeed, the integral above shows that is a functional of . Moreover, there are two sources of randomness to consider: the algorithmic randomness arising from , and the randomness arising from the training set . Going forward, we will focus on the algorithmic fluctuations of due to , and our analysis will always be conditional on .
Recall that the value represents the ideal prediction error of an infinite ensemble trained on . Hence, a natural way of defining algorithmic convergence is to say that it occurs when is large enough so that the condition holds with high probability, conditionally on , for some user-specified tolerance . However, the immediate problem we face is that it is not obvious how to check such a condition in practice.
From the right panel of Figure 1, we see that for most , the inequality is highly likely to hold — and this observation can be formalized using Theorem 3.1 later on. For this reason, we propose to estimate as a route to measuring algorithmic convergence. It is also important to note that estimating the quantiles of would serve the same purpose, but for the sake of simplicity, we will focus on . In particular, there are at least two ways that an estimate can be used in practice:
Checking convergence for a given ensemble. If an ensemble of a given size has been trained, then convergence can be checked by asking whether or not the observable condition holds. Additional comments on possible choices for will be given shortly.
Selecting dynamically. In order to make the training process as computationally efficient as possible, it is desirable to select the smallest needed so that is likely to hold. It turns out that this can be accomplished using an extrapolation technique, due to the fact that tends to scale like (cf. Theorem 3.1). More specifically, if the user trains a small initial ensemble of size and computes an estimate , then “future” values of for can be estimated at no additional cost with the re-scaled estimate . In other words, it is possible to look ahead and predict how many additional classifiers are needed to achieve . Additional details are given in Section 4.2.
Having described the basic formulation of the problem, it is important to identify what challenges are involved in estimating . First, we must keep in mind that the parameter describes how fluctuates over repeated ensembles generated from — and so it is not obvious that it is possible to estimate from the output of a single ensemble. Second, the computational cost to estimate should not outweigh the cost of training the ensemble, and consequently, the proposed method should be computationally efficient. These two obstacles will be described in Sections 3.2 and 4.2 respectively.
Our proposed bootstrap method is described in Section 2, and our main consistency result is given in Section 3. Practical considerations are discussed in Section 4, numerical experiments are given in Section 5, and conclusions are stated in Section 6. The essential ideas of the proofs are explained in Appendices A and B, while the technical arguments are given Appendices C-E. Lastly, in Appendix F, we provide additional assessment of technical assumptions. All appendices are in the supplementary material.
Method
Based on the definition of in equation (1.3), we may view as a functional of , denoted
From a statistical standpoint, the importance of this expression is that is a functional of a sample mean, which makes it plausible that is amenable to bootstrapping, provided that is sufficiently smooth.
To describe the bootstrap method, let denote a random sample with replacement from the trained ensemble , and put In turn, it would be natural to regard the quantity
as a bootstrap sample of , but strictly speaking, this is an “idealized” bootstrap sample, because the functional depends on the unknown test point distribution . Likewise, in Section 2.1 below, we explain how each value can be estimated. So, in other words, if denotes an estimate of , then an estimate of would be written as
and the corresponding bootstrap sample is
Altogether, a basic version of the proposed bootstrap algorithm is summarized as follows.
Sample classifiers with replacement from .
Compute .
Return: the sample standard deviation of , denoted .
While the above algorithm is conceptually simple, it suppresses most of the implementation details, and these are explained below. Also note that in order to approximate quantiles of , rather than , it is only necessary to modify the last step, by returning the desired quantile of the centered values , with .
1 Resampling algorithm with hold-out or “out-of-bag” points
Return: the sample standard deviation of , denoted .
Since the use of a hold-out set is often undesirable in practice, we instead consider oob points — which are a special feature of bagging and random forests. To briefly review this notion, recall that each classifier is trained on a set of points obtained by sampling with replacement from . Consequently, each set excludes approximately 37% of the points in , and these excluded points may be used as test points for the particular classifier . If a point is excluded from , then we say “the point is oob for the classifer ”, and we write , where the set indexes the classifiers for which is oob.
Main result
Our main theoretical goal is to prove that the bootstrap yields a consistent approximation of as becomes large. Toward this goal, we will rely on two simplifications that are customary in analyses of bootstrap and ensemble methods. First, we will exclude the Monte-Carlo error arising from the finite number of bootstrap replicates, as well as the error arising from the estimation of . For this reason, our results do not formally require the training or hold-out points to be i.i.d. copies of the test point — but from a practical standpoint, it is natural to expect that this type of condition should hold in order for Algorithm 2 (or its oob version) to work well.
Second, we will analyze a simplified type of ensemble, which we will refer to as a first-order model. This type of approach has been useful in gaining theoretical insights into the behavior of complex ensemble methods in a variety of previous works Biau, Devroye and Lugosi 2008; Biau 2012; Arlot and Genuer 2014; Lin and Jeon 2006; Genuer 2012; Scornet 2016a; Scornet 2016b. In our context, the value of this simplification is that it neatly packages the complexity of the base classifiers, and clarifies the relationship between and quality of the bootstrap approximation. Also, even with such simplifications, the theoretical problem of proving bootstrap consistency still leads to considerable technical challenges. Lastly, it is important to clarify that the first-order model is introduced only for theoretical analysis, and our proposed method does not rely on this model.
Any randomized classifier may be viewed as a stochastic process indexed by . From this viewpoint, we say that another randomized classifier is a first-order model for if it has the same marginal distributions as , conditionally on , which means
Since takes values in the finite set of binary vectors , the condition (3.1) is equivalent to
where the expectation is only over the algorithmic randomness in and . A notable consequence of this matching condition is that the ensembles associated with and have the same error rates on average. Indeed, if we let be the error rate associated with an ensemble of independent copies of , then it turns out that
for all , where is the error rate for , as before. (A short proof is given in Appendix E.) In this sense, a first-order model is a meaningful proxy for with regard to statistical performance — even though the internal mechanisms of may be simpler.
Having stated some basic properties that are satisfied by any first-order model, we now construct a particular version that is amenable to analysis. Interestingly, it is possible to start with an arbitrary random classifier , and construct an associated in a relatively explicit way.
To do this, let be fixed, and consider the function
For any fixed , there is an associated partition of the unit interval into sub-intervals
such that the width of interval is equal to for . Namely, we put , and for ,
Now, if we let be fixed, and let Uniform$T_{1}(x)\in\{\boldsymbol{e}_{0},\dots,\boldsymbol{e}_{k-1}\}l$th coordinate equal to the following indicator variable
where . It is simple to check that the first-order matching condition (3.2) holds, and so is indeed a first-order model of . Furthermore, given that is defined in terms of a single random variable Uniform$T_{1},\dots,T_{t}U_{1},\dots,U_{t}\mathcal{D}liT_{i}[T_{i}(x)]_{l}=1\{U_{i}\in I_{l}(\vartheta(x))\}Q_{i}(x)=g(x,\mathcal{D},\xi_{i})$ in equation (1.2), we may make the identification
when the first-order model holds with .
To understand the statistical meaning of the first-order model, it is instructive to consider the simplest case of binary classification, . In this case, is a Bernoulli random variable, where . Since almost surely as (conditionally on ), the majority vote of an infinite ensemble has a similar form, i.e. . Hence, the classifiers can be viewed as “random perturbations” of the asymptotic majority vote arising from . Furthermore, if we view the number as score to be compared with a threshold, then the variable plays the role of a random threshold whose expected value is . Lastly, even though the formula might seem to yield a simplistic classifier, the complexity of is actually wrapped up in the function . Indeed, the matching condition (3.2) allows for the function to be arbitrary.
2 Bootstrap consistency
We now state our main result, which asserts that the bootstrap “works” under the first-order model. To give meaning to bootstrap consistency, we first review the notion of conditional weak convergence.
If a test point is drawn from class , then we denote the distribution of the random vector , conditionally on , as
For the given set , and each , the distribution has a density with respect to Lebesgue measure on , and is continuous on . Also, if denotes the interior of , then for each , the density is on , and is bounded on .
Suppose that the first-order model holds for all , and that Assumption 1 holds. Then, for the given set , there are numbers and such that as ,
In a nutshell, the proof of Theorem 3.1 is composed of three pieces: showing that can be represented as a functional of an empirical process (Appendix A.1), establishing the smoothness of this functional (Appendix A.2), and employing the functional delta method (Appendix A.3). With regard to theoretical techniques, there are two novel aspects of the proof. The problem of deriving this functional is solved by introducing a certain lifting operator, while the problem of showing smoothness is based on a non-smooth instance of the first-variation formula, as well as some special properties of Bernstein polynomials. Lastly, it is worth mentioning that the core technical result of the paper is Theorem A.1.
Practical considerations
In this section, we discuss some considerations that arise when the proposed method is used in practice, such as the choice of error rate, the computational cost, and the choice of a stopping criterion for algorithmic convergence.
In some applications, class-wise error rates may be of greater interest than the total error rate . For any , let denote the distribution of the test point given that it is drawn from class . Then, the error rate on class is defined as
and the corresponding algorithmic variance is
In order to estimate , Algorithm 2 can be easily adapted using either hold-out or oob points from a particular class. Our theoretical analysis also extends immediately to the estimation of (cf. Section A.1).
2 Computational cost and extrapolation
To explain the technique of extrapolation, the first step produces an inexpensive estimate by applying Algorithm 2 to a small initial ensemble of size . The second step then rescales so that it approximates for . This rescaling relies on Theorem 3.1, which leads to the approximation, . Consequently, we define the extrapolated estimate of as
In turn, if the user desires for some , then should be chosen so that
which is equivalent to .
In addition to applying Algorithm 2 to a smaller ensemble, a second computational benefit is that extrapolation allows the user to “look ahead” and dynamically determine how much extra computation is needed so that is within a desired range. In Section 5, some examples are given showing that can be estimated well via extrapolation when .
Based on the reasoning just given, the cost of running Algorithm 2 does not exceed the cost of training trees, provided that
where the factor arises from the extrapolation speedup described earlier. Moreover, with regard to the selection of , our numerical examples in Section 5 show that the modest choice allows Algorithm 2 to perform well on a variety of datasets.
Numerical Experiments
To illustrate our proposed method, we describe experiments in which the random forests method is applied to natural and synthetic datasets (6 in total). More specifically, we consider the task of estimating the parameter 3, as well as . Overall, the main purpose of the experiments is to show that the bootstrap can indeed produce accurate estimates of these parameters. A second purpose is to demonstrate the value of the extrapolation technique from Section 4.2.
Each of the 6 datasets were partitioned in the following way. First, each dataset was evenly split into a training set and a “ground truth” set , with nearly matching class proportions in and . (The reason that a substantial portion of data was set aside for was to ensure that ground truth values of and could be approximated using this set.) Next, a smaller set with cardinality satisfying was used as the hold-out set for implementing Algorithm 2. As before, the class proportions in and were nearly matching. The smaller size of was chosen to illustrate the performance of the method when hold-out points are limited.
After preparing , , and , a collection of 1,000 ensembles was trained on by repeatedly running the random forests method. Each ensemble contained a total of 1,000 trees, trained under default settings from the package randomForest (Liaw and Wiener 2002). Also, we tested each ensemble on to approximate a corresponding sample path of (like the ones shown in Figure 1). Next, in order to obtain “ground truth” values for with , we used the sample standard deviation of the 1,000 sample paths at each . (Ground truth values for each were obtained analogously.)
With regard to our methodology, we applied the hold-out and oob versions of Algorithm 2 to each of the ensembles — yielding 1,000 realizations of each type of estimate of . In each case, the number of bootstrap replicates was set to , and we applied the extrapolation rule, starting from . If we let and denote the initial hold-out and oob estimators, then the corresponding extrapolated estimators for are given by
Next, as a benchmark, we considered an enhanced version of the hold-out estimator, for which the entire ground truth set was used in place of . In other words, this benchmark reflects a situation where a much larger hold-out set is available, and it is referred to as the “ground estimate” in the plots. Its value based on is denoted , and for , we use
to refer to its extrapolated version. Lastly, class-wise versions of all extrapolated estimators were computed in an analogous way.
2 Description of datasets
The following datasets were each partitioned into , and , as described above.
A set of census records for 48,842 people were collected with 14 socioeconomic features (continuous and discrete) (Lichman 2013). Each record was labeled as 0 or 1, corresponding to low or high income. The proportions of the classes are approximately (.76,.24). As a pre-processing step, we excluded three features corresponding to work-class, occupation, and native country, due to a high proportion of missing values.
The observations represent 67,557 board positions in the two-person game “connect-4” (Lichman 2013). For each position, a list of 42 categorical features are available, and each position is labeled as a draw , loss , or win for the first player, with the class proportions being approximately .
This dataset was prepared from a set of 12,960 applications for admission to a nursery school (Lichman 2013). Each application was associated with a list of 8 (categorical) socioeconomic features. Originally, each application was labeled as one of five classes, but in order to achieve reasonable label balance, the last three categories were combined. This led to approximate class proportions .
A collection of 39,797 news articles from the website mashable.com were associated with 60 features (continuous and discrete). Each article was labeled based on the number of times it was shared: fewer than 1000 shares , between 1,000 and 5,000 shares (), and greater than 5,000 shares (), with approximate class proportions .
3 Numerical results
For each dataset, we plot the ground truth value as a function of , where the y-axis is expressed in units of %, so that a value is marked as 1%. Alongside each curve for , we plot the averages of (green) , (purple), and (orange) over their 1,000 realizations, with error bars indicating the spread between the 10th and 90th percentiles of the estimates. Here, the error bars are only given to illustrate the variance of the estimates, conditionally on , and they are not proposed as confidence intervals for . (Indeed, our main focus is on the fluctuations of , rather than the fluctuations of variance estimates.) Lastly, we plot results for the class-wise parameters in the same manner, but in order to keep the number of plots manageable, we only display the class with the highest value of at . This is reflected in the plots, since the values of for the chosen class are generally larger than .
To explain the plots from the user’s perspective, suppose the user trains an initial ensemble of classifiers with the ‘census income’ data. (The following considerations will apply in the same way to the other datasets in Figures 3-7.) At this stage, the user may compute either of the estimators or . In turn, the user may follow the definitions (5.1) to plot the extrapolated estimators for all at no additional cost. These curves will look like the purple or green curves in the left panel of Figure 2, up to a small amount of variation indicated by the error bars.
If the user wants to select so that is at most, say 0.5%, then the purple or green curves in the left panel of Figure 2 would tell the user that 200 classifiers are already sufficient, and no extra classifiers are needed (which is correct in this particular example). Alternatively, if the user happens to be interested in the class-wise error rate for , and if the user wants to be at most 0.5%, then the curve for the oob estimator accurately predicts that approximately 600 total (i.e. 400 extra) classifiers are needed. By contrast, the hold-out method is conservative, and indicates that approximately 1,000 total (i.e. 800 extra) classifiers should be trained. So, in other words, the hold-out estimator would still provide the user with the desired outcome, but at a higher computational cost.
Considering all of the datasets collectively, the plots show that the extrapolated oob and ground estimators are generally quite accurate. Meanwhile, the hold-out estimator tends to be conservative, due to an upward bias. Consequently, the oob method should be viewed as preferable, since it is both more accurate, and does not require data to be held out. Nevertheless, when considering the hold-out estimator, it is worth noting that the effect of the bias actually diminishes with extrapolation, and even if the initial value has noticeable bias at , it is possible for the extrapolated value to have relatively small bias at .
One last point to mention is that many of the datasets have discrete features, which may violate the theoretical conditions in Assumption 1. Nevertheless, the presence or absence of discrete features does not seem to substantially affect on the performance of the estimators. So, to this extent, the bootstrap does not seem to depend too heavily on Assumption 1. (See Appendix F.2 for further empirical assessment of that assumption.)
Conclusion
We have studied the notion of algorithmic variance as a criterion for deciding when a randomized ensemble will perform nearly as well as an infinite one (trained on the same data). To estimate this parameter, we have developed a new bootstrap method, which allows the user to directly measure the convergence of randomized ensembles with a guarantee that has not previously been available.
With regard to practical considerations, we have shown that our bootstrap method can be enhanced in two ways. First, the use of a hold-out set can be avoided with the oob version of Algorithm 2, and our numerical results show that the oob version is preferable when hold-out points are scarce. Second, the extrapolation technique substantially reduces the cost of bootstrapping. Furthermore, we have analyzed the cost of the method in terms of floating point operations to show that it compares favorably with the cost of training a single ensemble via random forests.
Acknowledgements
The author thanks Peter Bickel, Philip Kegelmeyer, and Debashis Paul for helpful discussions. In addition, the author thanks the editors and referees for their valuable feedback, which significantly improved the paper.
References
Outline of appendices and the proof of Theorem 3.1
Here we explain how the the main components of the proof of Theorem 3.1 fit together. First, in Appendix A.1, we show that under a first-order model, there is an explicit functional such that
where are drawn with replacement from , then the bootstrap counterpart of (1) is given by
The remainder of the appendices are organized as follows. Appendices B, C, and D contain the arguments for proving Theorem A.1 on Hadamard differentiability. Throughout these arguments, we will refer to various technical lemmas that are stated and proved in Appendix E. Also, we henceforth assume that the first-order model holds, so that for , and the sets and are synonymous. Lastly, Appendix F discusses the theoretical and empirical assessment of Assumption 1.
Appendix A Proof of Theorem 3.1
Working under the first-order model, our aim in this subsection is to construct an explicit functional such that
which implies that may be written as .
Since many of our arguments will rely on special properties of , we briefly summarize these properties below.
The fact that respects composition of functions is the only property that takes some care to verify, but we omit the calculation for brevity. In turn, the “Inverses” property follows by combining the “Composition” and “Identities” properties.
where the set is defined as
where . Consequently, we have
A.2 Hadamard differentiability of ϕl\phi_{l}
Let B be a normed space. A map is Hadamard differentiable at tangentially to , if there is a continuous linear map such that as ,
for all converging sequences of positive numbers and functions , such that for every , and . In particular, the linear map is referred to as the Hadamard derivative of at .
Although each functional is defined in terms of the particular set and the particular measure , the Hadamard differentiability of is only mildly dependent on their structure. For each measure , the only property we need is that it satisfies Assumption 1. Regarding the set , it is simple to check that its complement in is a convex set with non-empty interior. In other words, the functional may be written as for some convex set with non-empty interior. So, given that the Hadamard derivative of is that same as that of , up to a sign, we state the result in terms of a generic functional that arises from such a set , and such a measure .
where is the outward normal to at the point , and is Hausdorff measure on .
A high-level proof is given in Appendix B. In the next subsection, we apply this result in conjunction with the functional delta method to complete the proof of bootstrap consistency (Theorem 3.1).
A.3 Functional delta method
With this lemma in hand, Theorem 3.1 on bootstrap consistency follows quickly from Theorem A.1. Specifically, if we consider , with each as in equation (A.7), and define , then the relations (1) and (2) lead to
where we recall that in the first-order model, as explained on p.3.1.1 of the main text. Note also that implicitly depends on through the function .
Appendix B A high-level proof of Theorem A.1
Here we give a proof of Theorem A.1 that focuses on the key ideas and delegates the technical pieces to Appendices C, D, and E. Consider a sequence of positive numbers and functions such that for every , and . Define the distribution function by
and define its lifted version by
The fact that the range of is contained in follows from the properties of listed earlier. Our aim is to evaluate the limit of the following difference as ,
Here, we have used the fact that , which follows from . Since approaches as , we may view the preimage as a perturbed version of the set . From this perspective, it is natural to interpret the right side of equation (B.1) through the lens of the first variation formula, introduced in Section 1.1, with playing the role of a volume, playing the role of a manifold, and playing the role of the map with .
In its classical form, the first variation formula deals with smooth maps on smooth manifolds. However, since the map need not be smooth, our proof proceeds by constructing a smoothed version of . In order to do this, it is enough to smooth the univariate function and apply the linear operator . The smoothing will be done using the linear Bernstein smoothing operator, denoted , where is an integer-valued smoothing parameter (lorentz; devoreconstructive).
where is the th Bernstein basis polynomial where , and ranges over . Below, we will use of some special properties of this operator. First, when is a cumulative distribution function, it turns out that is also a cumulative distribution function. Second, when is continuous, we have the uniform limit as . The details of all the properties of we will use are summarized in Lemma E.1 of Appendix E.
When applying the operator , the smoothed version of will be denoted by
Likewise, the smoothed version of will be denoted by
which is a map from to itself. (It is not immediately obvious that takes values in , and this follows from being a cumulative distribution function, by Lemma E.1, as well as the “Simplices” property of .)
The remainder of the proof involves two essential parts. First, we prove a special version of the first variation formula for the smoothed maps . Second, we show that this smoothing leads to negligible approximation error. To quantify the approximation error from smoothing, define the remainder according to the following equation
Due to the smoothness of , the difference quotient on the right may be represented with a change of variable formula
where is the Jacobian matrix of at the point . This step is justified by Lemmas E.4, E.6, and E.7, which also prove invertibility of . From the above integral formula, Proposition C.1 in Appendix C provides the following limit
Next, Proposition D.1 in Appendix D shows that replacing with its smoothed version leads to negligible approximation error, i.e.
Consequently, by separately applying the operations and to equation (B.3), and then taking in each case, it follows that
Lastly, it is simple to check that the right side is a continuous linear functional of , as required by the definition of Hadamard differentiability. ∎
Appendix C A first variation formula
Assume the conditions of Theorem A.1. Then, in the notation of Appendix B, the following limit holds,
Using an expansion for given in Lemma E.5 of Appendix E, as well as the boundedness of on , the integral on the left side of equation (C.1) may be written as
where is the divergence of evaluated at , and is a sequence of numbers not depending on . (In addition, note that lies in whenever , which follows from Lemma E.4, and the invariance of domain principle (Hatcher, Theorem 2B.3).)
We now evaluate the limits of the two integrals in line (C.4) separately. Due to the multivariate mean value theorem, for each fixed , there is a point on the line segment between and such that
Also, the points may be taken to satisfy as , since for every fixed and fixed , which follows from Lemma E.9. By the Cauchy-Schwarz inequality, the inner product in equation (C.5) is dominated by a number depending only on , since is bounded on by assumption, and is finite by Lemma E.9. Furthermore, Lemma E.9 gives the convergence for every , where we define
Hence, the continuity of and the dominated convergence theorem lead to
Turning our attention to the second integral in line (C.4), Lemma E.3 ensures that the divergence
converges uniformly to on as . Combining this with the facts that for every (Lemma E.9) and that is continuous (since is smooth), it follows that
Furthermore, it is simple to check that this pointwise limit is dominated by a constant (using Lemma E.3), and so
The preceding calculations may now be combined using the basic differential identity
which shows that the quantity in line (C.4) tends to as with held fixed. In turn, Stokes’ theorem may be applied to this divergence integral. To be specific, an applicable version of the Stokes’ theorem that holds for convex domains may be found in Leoni. (When referencing that result, note that bounded convex domains have Lipschitz boundaries (Grisvard, Corollary 1.2.2.3), and also, that the regularity assumptions on imply that is a Lipschitz vector field on .) Hence, for every ,
Finally, since , the uniform approximation property of Bernstein polynomials for continuous functions (Lemma E.1) implies that
uniformly on as . Hence, the right side of equation (C.7) tends to by the dominated convergence theorem, which completes the proof. ∎
Appendix D Smoothing error is negligible
Let be as defined in equation (B.3), and suppose the conditions of Theorem A.1 hold. Then,
It is simple to check that may be written as
We will argue that both terms on the right side are small. Note that the set consists of the points such that and . Now consider a particular point , and note that if the Euclidean distance between the points and is written as , then both of the points and must be within a distance from the boundary . In other words, both of the points and lie within the tubular neighborhood of of radius . (The same reasoning applies to the other set .)
Consequently, applying the reasoning above to both terms on the right side of equation (D.1) gives,
Furthermore, if is a random vector distributed according to , then this upper bound may be written as
(This definition of will be used later on for handling the formal possibility that may be zero. Note that is positive for all and .) Clearly, the definition of gives
Next, we obtain an upper bound on this probability using a volume argument. Lemma E.6 in Appendix E shows that has a density, say , with respect to -dimensional Lebesgue measure. Also, Lemmas E.4 and E.7 imply that the random vector lies in with probability 1 for all and . Therefore,
To control the volume of the right side of the bound (D.6), it is convenient to consider the Hausdorff measure of . Specifically, it is a fact from geometric measure theory that the -dimensional Hausdorff measure of , denoted , can be expressed as
In particular, is a sequence of positive numbers with as , and so when is fixed, this means
We now turn our attention to the factor in the bound (D.6). Lemma E.6 ensures there is a constant , such that the following bound holds for every ,
Combining lines (D.6), (D.8), and (D.9), we conclude that for every ,
Finally, the proof is completed using the fact that as , which is shown in Lemma E.8.∎
Appendix E Technical lemmas
To simplify the statements of the lemmas in this section, the notation in the previous appendices will be generally assumed without comment.
Recall and that we may express and as
for every fixed . This holds because when is fixed, we have , due to the first-order matching condition (3.1).∎
The Bernstein smoothing operator satisfies the following properties.
For any function , the following limit holds
We refer to the book (devoreconstructive) for general background on these properties. The first property is given in Theorem 2.3 of (devoreconstructive, Chapter 1). The second property is proven after equation 1.7 of (devoreconstructive, Chapter 1).
Regarding the third property, if we let be arbitrary, it is enough to show that the derivative is strictly positive. To this end, it is shown in equation 2.2 of (devoreconstructive, Chapter 10) that satisfies
where we put . If is non-decreasing and non-constant then
So, because all the terms are non-negative, at least one of them must be positive. In turn, equation (E.1) implies that must be positive, since all the values are positive for all . ∎
Let denote the differentiation operator on univariate functions. If this operator is applied to a function with domain $\boldsymbol{D}(g)(0,1)$.
Let be the indicator function of . Then, for any fixed , we have the identity,
The identity (E.2) is a direct consequence of from Lemma E.1. To prove the limit, first note that because the functions are polynomials on $C_{s}:=\displaystyle\max_{0\leq j\leq s}\sup_{u\in(0,1)}|b_{j}^{\prime}(u;s)|s$,
For any fixed , there is a number not depending on such that the inequality
holds for all . Furthermore, as , we have the uniform limit
where .
Proof. From the definition of in equation (C.2), we have
The last expression is bounded in absolute value for every , and every , by
which is finite by the uniform limit in Lemma (E.2). (Hence, the bound (E.4) is proved.) Lastly, the limit (E.5) follows from Lemma E.2 and the definition . ∎
For any and , the following three statements are true:
The map is bijective and continuous on , and is also on .
The Jacobian matrix is non-singular for all .
The inverse map is on .
It is simple to verify that is continuous on , and is on , due to the smoothness of . To show that is bijective, it is enough to show that is bijective (due to the “inverses” property of stated in Appendix A.1). In turn, the fact that is bijective follows from part (c) of Lemma E.1.
To see that the Jacobian matrix is non-singular for , it is enough to check that is on the set , because we may differentiate the identities
to establish the inverse of via the chain rule. Using the “Inverses” property of , we have , and it follows that will be as long as is. Finally, the fact that is follows from the strict monotonicity of and the univariate inverse function theorem.
The next lemma gives a uniform expansion for the determinant of on .
Then, for any , there is a number not depending on , such that the following bound holds for all large ,
where is a bivariate polynomial whose degree and coefficients do not depend on or .
It is simple to check that the Jacobian matrix is lower-triangular for all , and so the determinant of is the product of the diagonal entries. Consequently, using the invertibility of shown in Lemma E.4, we obtain the following expression for all ,
where we put , which lies in when does. By the definition of in equation (C.2), we have for each ,
Due to Lemma E.3, there is a number not depending on such that the bound
where is a bivariate polynomial function whose degree and coefficients do not depend on or . In particular, this upper bound does not depend on the point . The proof is completed by combining lines (E.6) and (E.9) with the elementary bound
Assume the conditions of Theorem A.1 hold, and let be a random vector distributed according to . Then, the random vector has a density with respect to Lebesgue measure on , given by
Furthermore, the density is asymptotically bounded, in the sense that for each , we have
where .
Lemma E.4 and the standard change of variables formula ((folland, Theorem 2.47)) give the stated expression for . The boundedness condition (E.12) follows from Lemmas E.3 and E.5, as well as the boundedness of on .∎
Suppose the conditions of Theorem A.1 hold, and let be a convex set. Then,
Let be as defined in equation (D.5). Then, there is a sequence of numbers such that
The limit (E.14) follows from the identity
and the continuity of .
Appendix F Assessment of Assumption 1
In the first portion of this section, we provide theoretical support for Assumption 1 in the context of two types of ensemble methods: the voting Gibbs classifier, and bagged decision stumps. Later on, we also provide empirical justification in the context of random forests.
Before dealing with examples of specific ensemble methods, we first give a general result concerning the existence of the density in Assumption 1. In essence, the following proposition shows that exists when the function is sufficiently smooth.
where is the Jacobian matrix of evaluated at , the region of integration is the pre-image , and refers to -dimensional Hausdorff measure on .
The result is a consequence of the co-area formula and Sard’s Theorem. The details may be found by combining Theorem 10.4 and line 10.6 in the book (Simon 1983).∎
Beyond the existence of , Assumption 1 also requires the gradient of to bounded and continuous. However, given that the general formula (F.1) for is quite complex, the analysis of the gradient of seems to be prohibitive. For this reason, we focus primarily on the existence of in the examples below — by analyzing the smoothness of . Indeed, even verifying the smoothness of is non-trivial in general.
F.1.1 Voting Gibbs classifier
which is to say that randomly labels as 1 with probability . The classifiers are then aggregated via majority voting.
In turn, the smoothness of will be inherited from the smoothness of via equation (F.2). For example, in the case of Bayesian logistic regression, we have
and it can be checked that this is permitted (for instance) when is continuous in , and is supported on a compact rectangular domain.
F.1.2 Bagged decision stumps
and represents an average over all bootstrap samples, with
In this situation, the statement below formalizes the asymptotic smoothness of , and is a slight reformulation of Proposition 2.1 in the paper (Bühlmann and Yu 2002). The significance of this fact is that it allows the asymptotic smoothness of to be understood in terms of the limit of the standardized bootstrap distribution, , which can be derived analytically in special cases.
“It is worth noting that [bootstrap consistency] is not necessary for bagging to work as long as the resulting bagged estimator is sensible itself. Conditional on the original sample, spreads around [its population counterpart] by taking one of the discrete values between original sample points. The resulting bagged stump estimator is a weighted average of the stump estimators with split points between the original sample values. Thus, bagging is still a smoothing operation, similar to the assertion in Proposition 2.1, although exact analysis seems difficult and we leave it as an open research problem.”
F.2 Empirical assessment of Assumption 1
Here, we empirically assess Assumption 1 by seeing how well can be approximated by a distribution with a smooth density function. For convenience, we only consider the situation of binary classification, because in this case, is a univariate distribution on , which simplifies the assessment of goodness-of-fit.
A natural class of smooth distributions on is the Beta family, parameterized by . For any fixed , the densities in this family are given by
where is the Beta function.
The main idea of these experiments is to generate approximate samples from , and then see how well these samples can be fit by a member of the Beta family. Noting that depends on a particular training set , we will consider three instances of arising form the datasets ‘census income’, ‘synthetic discrete’, and ‘synthetic continuous’ from the main text.
For each of the three datasets, we prepared the training set and the test set as described in Section 5. To generate approximate samples from , we first approximated the function using the sample average , obtained from an ensemble of size , trained on , via the package randomForest with default settings (Liaw and Wiener 2002). Next, letting denote the samples from class in the test set , we used the values as approximate samples from . In turn, these approximate samples were used to estimate and via the method of moments, using the ‘mme’ option in the package fitdistrplus (fitdistrplus). Below, we write and to refer to the estimates associated with .
To assess the quality of fit, we constructed quantile-quantile (QQ) plots by sorting the values and plotting them against a corresponding set of quantiles from the fitted distribution Beta(), with the results shown below. Overall, the plots indicate a good fit, with strong conformity to the diagonal line .