Strobl 2007 - Bootstrap-Induced Association

Summary

Source 2 of the importance bias. Even with unbiased trees (cforest), forests grown on bootstrap samples drawn with replacement still favour many-category variables. The paper’s explanation, via a simple experiment (Fig. 11): under independence, -values computed on the original sample are uniform, but recomputed on a bootstrap sample they shift toward zero — “the bootstrap sampling artificially induces an association”. Duplicating and omitting observations perturbs contingency-table cell counts, and smaller cells (more categories) are perturbed more. The effect does not vanish as grows (bootstrap size grows with ), but disappears with subsampling without replacement. Hence the prescription: unbiased trees and sampling without replacement.

Overview

The clue (§“Variable selection bias…”, closing paras): split-selection bias is stronger in randomForest, but cforest + bootstrap still shows cardinality-dependent selection frequencies (Fig. 1, bottom-left) and permutation-importance variance (Figs 3-4, bottom-left). “Thus, there must be another source of bias, besides the variable selection bias in the individual trees”. Comparing left and right columns of Figs 1 and 5 locates it in the resampling scheme. Rather than analyse the full forest, the authors use “a much simpler independence test for the explanation”.

Main Content

Figure 11 — Effects induced by bootstrapping

Setup. Null design, categorical predictors only (2, 4, 10, 20 levels), binary , 1000 simulated data sets. In each run, a test of independence between each and is computed (a) on the original sample, (b) on one bootstrap sample drawn with replacement from it.

Result. (a) Left plots: boxplots of -values “range from 0 to 1 with median 0.5 as expected”, i.e. uniform. (b) Right plots: the distribution of -values “is shifted towards zero”.

Caption (paraphrased). Distribution of the values of tests of each categorical variable and the binary response in the null case; left from the original sample, right from the bootstrap sample.

Mechanism 2: bootstrap resampling manufactures association, more so for many categories

  1. Every finite sample deviates slightly from independence, even when generated under it.
  2. Bootstrap sampling with replacement aggravates the deviation: “the cell counts in the contingency table are affected by observations that are either not included or are doubled or tripled in the bootstrap sample, and therefore the bootsrap sample deviates notably from the null hypothesis – even if the original sample was generated under the null hypothesis.” (verbatim, typo in original)
  3. More categories ⇒ bigger effect: larger tables (e.g. for ) have smaller absolute cell counts than smaller tables ( for ), and “excluding or duplicating an observation produces more severe variations from the null hypothesis.”
  4. Not cured by larger (verbatim): “This effect is not eliminated if the sample size is increased, because in bootstrap sampling the size of the original sample and the bootstrap sample size increase simultaneously. However, if subsamples are drawn without replacement the effect disappears.”
  5. Link to bootstrap testing theory: Bickel & Ren point out that bootstrap hypothesis testing fails whenever the distribution of a statistic in the bootstrap sample, rather than its distribution under the null hypothesis, is used for inference. Tree growing on a bootstrap sample does exactly this when it judges associations.

Effect on importances. The apparent association hits both measures available in cforest: selection frequency directly, and permutation importance because many-category variables are “selected more often and gain positions closer to the root node” (as in ^thm-propagation).

Relative size of the two mechanisms

In randomForest, the bootstrap effect “is mostly superposed by the much stronger effect of variable selection bias” (Figs 1-9, top rows: with vs without replacement look alike). Only when cforest removes selection bias are the with/without-replacement differences obvious (bottom rows). Conclusion (verbatim): “in order to be able to reliably interpret the variable importance measures of a random forest, the forest must be built from unbiased classification trees, and sampling must be conducted without replacement.”

Proof sketch (vault addition). Write the Pearson statistic for (with levels) vs binary as , with on the original sample under the null. Conditionally on the original sample, bootstrap cell counts are multinomial around the original counts, so the bootstrap deviation is (original deviation) + (fresh resampling noise of the same order). Both pieces are per cell, so in expectation (original ) + (an independent -sized term), roughly doubling the statistic while it is still referred to . The doubling holds for every — hence no improvement with sample size — and its effect on the -value grows with the degrees of freedom: for . A subsample of size without replacement has finite-population-corrected noise and no duplicated observations, and its -values stay approximately uniform.

Example: reproducing Figure 11 at two sample sizes (vault reproduction, not from the paper)

Setup. 1000 runs; for , independent; Pearson test (no continuity correction) on the original sample, on one bootstrap sample of size , and on one subsample of size without replacement. Entries: median -value / share of .

originalbootstrapsubsample
12020.50 / 0.050.34 / 0.160.50 / 0.05
12040.49 / 0.050.20 / 0.260.51 / 0.04
120100.48 / 0.040.06 / 0.480.49 / 0.04
120200.47 / 0.030.02 / 0.670.45 / 0.02
120020.50 / 0.040.38 / 0.140.52 / 0.05
120040.51 / 0.050.20 / 0.260.49 / 0.04
1200100.52 / 0.050.05 / 0.500.50 / 0.04
1200200.52 / 0.050.01 / 0.730.51 / 0.04

Interpretation. A bootstrap sample makes a pure-noise 20-level factor look “significant” at 5% in about two thirds of runs; tenfold more data does not help. Subsampling without replacement keeps the null calibrated. This confirms all three claims of the mechanism: shift toward zero, gradient in , and invariance to .

Examples

Example: bootstrapped feature screening in marketing pipelines

Setup. An analyst bootstraps weekly data (156 rows) to get “stability” of a feature-screening step that keeps any feature whose association test with the KPI has , then counts how often each feature is kept.

Problem. The bootstrap inflates apparent association for every feature, most for high-cardinality ones (a 20-level region code has ~8 weeks per level). The “stability” count rewards cardinality.

Fix. Use subsamples without replacement (e.g. as in stability selection), or test with a proper null (permute within the resample). For time-ordered data, resample in blocks — and note that bootstrapping weekly time series has its own dependence problems (Bergmeir Hyndman Koo 2018 - CV for Time Series - Overview).

Connections

See Also