4
$\begingroup$

I'm trying to decide between bootstrap and cross-validation for thoroughly evaluating predictive model performance.

Bootstrap:

  • Samples data with replacement, creating B > 1000 (or more) diverse training sets, where each observation is treated idependently due to sampling with replacement! This means that the empirical distribution function is used as a drop-in replacement for the real world distribution from which the samples are drawn.
  • Dynamically Use out-of-bootstrap (out-of-bag) (OOB) observations as holdout sets: This eliminates the need for a separate holdout set and can provide a more reliable estimate of predictive out-of-sample performance.
  • Potentially captures more real-world variance (by sampling with replacement, i.e. making use of the emprical distribution function)

If I had to evaluate two different models, I would

  1. produce B=1000 ... bootstrap resamples of the training dataset
  2. evaluate the two models on the B different out-of-bag test sample sets
  3. compute paired model performance differences (performance model 1 - performance model 2, where the difference is taken for an identical OOB test set), pairing would be used for https://en.wikipedia.org/wiki/Variance_reduction
  4. make a histogram of the paired model performance differences
  5. if the density of model performances is visibly shifted away from 0, then one of the models outperforms the other one (from this one could also device some test for 95% certainty of improvement ...)

Cross-Validation:

  • Splits data into folds, using different folds for training and testing. Can be more efficient, especially with limited data. Might lead to "correlated" training sets, especially in LOOCV (the training sets almost do not change, except for one observation)

For comparing two models, I would do the same as in the bootstrap case (just without having out-of-bag test samples, but having maximally N=number of observations different hold-out sets in the case of LOOCV).

Question:

Given that bootstrap can introduce more variability in training sets (by resampling with replacement) and leverage OOB data for validation, wouldn't it provide a more realistic estimate of out-of-sample performance compared to cross-validation (which essentially is resampling without replacement)? Is especially the potential "correlation" between cross-validation training sets a significant concern?

PS: I tried to search stackoverflow and came up with similar questions, but they do not discuss the potential correlation problem of CV training sets:

$\endgroup$
3

2 Answers 2

4
$\begingroup$

There are different ways to use the bootstrap for model validation. That might be leading to some confusion in both this and other pages on this site.

The method proposed by the OP and used in most of the links in the question and another answer here is to take a bootstrap sample, build the model on it, and evaluate its performance on the cases in the full data set that were omitted from the bootstrap sample. Repeat many times. That's often called the "out of bag" method.

That's not the method most consistent with the fundamental bootstrap principle, however: that taking bootstrap samples from the original full data set mimics the process of taking the original full data set from the underlying population.

Under that bootstrap principle, what you want to do is to evaluate a model from a bootstrap sample on the original full data set. That's most similar to how the model from the original full data might perform on application to the underlying population. Furthermore, comparing the performance of that model between its own bootstrap sample and on the original full data set provides an estimate of the optimism of the modeling process with respect to its performance in the underlying population. (If there has been some set of predictor-selection or similar steps involved in building the model, this method should involve all those steps for each bootstrap sample.)

Do the above on many bootstrap samples to get an averaged estimate of the optimism for whatever measure of model performance you want. You then might correct the original model developed from the full data set for its estimated optimism. That's called the "optimism bootstrap." Frank Harrell outlines and illustrate its use in this answer; it's implemented by tools in his rms package in R.

Harrell used those tools to compare several validation methods, and to evaluate how well they represent performance of logistic regression models on an underlying population, on this web page. In that simulation study, at least, "bootstrap is better than or equal to all cross-validation strategies tried." Also: "The relative comparison of validation methods depends in general on which index you are validating."

As you look through studies comparing "bootstrap" and other validation methods, make sure to know whether the authors used the "out of bag," the "optimism" bootstrap, or some other variant. If there was some form of model selection, ask whether all the modeling steps were repeated on each bootstrap sample. Pay close attention to the particular index of model performance evaluated.

$\endgroup$
12
  • $\begingroup$ Hmmm, thank you 1000 times for pointing out my blind spot. I always assumed that using out-of-bag (by chance not chosen samples during Bootstrapping) was the gold standard. I would not have used optimism corrected bootstrap (because intuitively the training samples might have been learnt by heart using an machine learning model, imagine a completely over fitted neural network). I was not really aware that Prof. Harrell and RMS referred to optimism corrected bootstrap. Now still I completely miss how evaluating performance on training examples with an overfitted can be reliable in any sense... $\endgroup$
    – Ggjj11
    Commented Nov 5 at 20:36
  • 1
    $\begingroup$ @Ggjj11 Your sense is correct that evaluation on a "training set" doesn't evaluate the model per se. What you evaluate via optimism bootstrap (or any validation method used solely on a "training set") is the estimated performance of the modeling method, not the model itself. Unless you have the tens of thousands of cases needed for a reliable separate train/test split, however, you have to do what you can with what you have. $\endgroup$
    – EdM
    Commented Nov 5 at 20:47
  • 1
    $\begingroup$ @Ggjj11 the optimism bootstrap doesn't limit itself to out-of-bag cases. The "paired comparison" to estimate the optimism of a model from a bootstrap sample is between the performance of the model on its own bootstrap sample and its performance on the entire original data set. At the least, that means the model is being evaluated on about 3 times as many cases as it would be if you restricted to out-of-bag cases. That's also most consistent with the analogy stated in the bootstrap principle. $\endgroup$
    – EdM
    Commented Nov 5 at 20:52
  • 2
    $\begingroup$ A way to help understand the bootstrap philosphy: The model built on a bootstrap sample will duplicate and triplicate some observations hence will be super-overfitted. Evaluating on the original dataset equates to regular overfitting. Superoverfitting minus regular overfitting estimates the effect of overfitting the original dataset minus what you get on new independent data. $\endgroup$ Commented Nov 5 at 21:26
  • 1
    $\begingroup$ @Ggjj11 there's nothing to stop you from using multiple methods for internal validation. I recall having some problems with the studies in the web pages you just linked (a single example rather than an average of multiple samples, no seed value specified), but I recognize that the comparison by Harrell that I cite was limited to p<n and a sample size of 500. The pages you link involved smaller samples of 50 (where bootstrap is less reliable) and p>>n. I intend to pursue those differences further. $\endgroup$
    – EdM
    Commented Nov 7 at 22:05
0
$\begingroup$

TLDR/summary:

  • Simulation studies have compared bootstrap and cross-validation methods for assessing generalization performance (i.e. estimated prediction accuracy for new data the model has not seen before).
  • In general, there is no clear winner method that is best all of the time. However, repeated 5 or 10-fold CV and the bootstrap 632+ methods are often recommended, it seems.

Detailed answer:

Here are some notes from a few papers that compare resampling methods for assessing generalization performance:

Molinaro (2005). Prediction error estimation: a comparison of resampling methods. Bioinformatics, 21(15), 3301-3307.

  • leave one out CV, 5- and 10-fold CV, and the .632+ bootstrap had the lowest mean square error.
  • The .632+ bootstrap is quite biased in small sample sizes with strong signal-to-noise ratios
  • Sort of seems to recommend 10-fold CV among the compared methods. Shows situation where .632+ boot is biased.

Iba, K. (2021). Re-evaluation of the comparative effectiveness of bootstrap-based optimism correction methods in the development of multivariable clinical prediction models. BMC Medical Research Methodology, 21, 1-14.

  • Although this paper did not assess cross-validation, they compared 3 bootstrap methods, 2 of which are mentioned by the comments to your post.
  • Compared Harrell's bias correction (i.e. the Efron and Gong optimism bootstrap method) and the .632 and .632+ estimators
  • Under relatively large sample settings (roughly, events per variable ≥ 10), the three bootstrap-based methods were comparable and performed well. However, all three methods had biases under small sample settings, and the directions and sizes of biases were inconsistent.
  • In general, Harrell’s and .632 methods had overestimation biases when event fraction become lager. .632+ method had a slight underestimation bias when event fraction was very small. Although the bias of the .632+ estimator was relatively small, its root mean squared error (RMSE) was comparable or sometimes larger than those of the other two methods, especially for the regularized estimation methods.
  • In general, the three bootstrap estimators were comparable, but the .632+ estimator performed relatively well under small sample settings, except when the regularized estimation methods are adopted.
  • Overall, IMO, there is not a clear winner from the 3 bootstrap methods in this paper. I guess the .632+ seems slightly better based on their results, but its hard to say.

Ch 4 of Kuhn, M. (2013). Applied predictive modeling.

K-fold CV:

  • For k-fold CV, the choice of k is usually 5 or 10
  • As k gets larger the bias of the technique becomes smaller (i.e., the bias is smaller for k = 10 than k = 5). In this context, the bias is the difference between the estimated and true values of performance.
  • As k gets larger, the bias gets smaller but the variance gets greater
  • From a practical viewpoint, larger values of k are more computationally burdensome. In the extreme, LOOCV is most computationally taxing because it requires as many model fits as data points and each model fit uses a subset that is nearly the same size of the training set.
  • Molinaro (2005) found that leave-one-out and k =10-fold cross-validation yielded similar results, indicating that k = 10 is more attractive from the perspective of computational efficiency.
  • Research indicates that** repeating k-fold crossvalidation** can be used to effectively increase the precision of the estimates while still maintaining a small bias.

Bootstrap:

  • Discusses the "out of bag bootstrap method", i.e. fit a model to a bootstrap sample and predict on the samples that were omitted from that bootstrap sample (~ 1/3 of samples will be held out of each bootstrap sample when sampling with replacement)
  • In general, out-of-bag bootstrap error rates tend to have less uncertainty/variance than k-fold cross-validation (Efron 1983). However, on average, 63.2 % of the data points the bootstrap sample are represented at least once, so out-of-bag bootstrap has bias similar to k-fold cross-validation when k ≈ 2. If the training set size is small, this bias may be problematic, but will decrease as the training set sample size becomes larger
  • A few modifications of the simple bootstrap procedure have been devised to eliminate this bias: the .632 and .632+ methods, the latter performs better for smaller sample sizes
$\endgroup$
9
  • $\begingroup$ .632 and .632+ had advantages only when a disontinuous scoring rule was being used, I think. When using a good accuracy score the advantage largely disappears, when compared to the ordinary Efron-Gong optimism bootstrap. $\endgroup$ Commented Nov 5 at 21:27
  • 1
    $\begingroup$ @FrankHarrell Interesting. I recall you saying on Datamethods that the optimism bootstrap may perform worse than repeated 10-fold CV when there are more predictors than samples (P > N). So in general, when P > N, should we use repeated 10-fold CV, but when P < N, the optimism bootstrap is often better? $\endgroup$
    – jarbet
    Commented Nov 6 at 5:12
  • 1
    $\begingroup$ That's a good summary although sometimes we worry about the bootstrap only when P >> N. We try to use the bootstrap when we can because you need to repeat 10-fold CV 50 or 100 times to get enough precision, so the bootstrap is faster (e.g. 300 repetitions vs 1000). Also, the bootstrap does a better than than CV in quantifying the stability of feature selection when you are doing feature selection (not usually recommended). $\endgroup$ Commented Nov 7 at 14:45
  • $\begingroup$ @Frank Harrell, thank you so much! I think I was looking for a recommendation like yours in the link above. But I wonder: do you know investigations for the "out of bag bootstrap" performance (on samples not drawn for training)?. Intuitively, this should not rely on the optimism estimation, which might be underestimated (due to a hypothetical asymmetry between optimism for training examples and optimism for non-training examples). I am not friends with the optimism bootstrap yet (but will experiment tomorrow) $\endgroup$
    – Ggjj11
    Commented Nov 7 at 22:55
  • $\begingroup$ @jarbet, is this Efron 1983 paper you cite exactly answering my performance question about the oob bootstrap performance? $\endgroup$
    – Ggjj11
    Commented Nov 7 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.