[R] Implementations of bootstrap aggregation

Alex Fun quickling at gmail.com
Wed Apr 26 01:40:16 CEST 2017


I would like to do bootstrap aggregation of a model (currently fit
with glm()) so that:

1) Data observations are replicated as N bootstrap samples.
2) The specified model is fit to each sample.
3) Error is calculated on out of bag samples.
4) Have an easy way of making model predictions.
5) + all other sensible features that you can inherit from a random
forest implementation.

I can find plenty of packages (ipred, randomForest, etc) that bag
trees but none that will give the bootstrap aggregation features to a
general model. For a glm, the closest is probably the package
randomGLM, however this does not seem to let you fix the covariates in
the glm model. Does anyone know of neat/elegant implementations of the
general bagging procedure, or should I write something myself, like
this (horrible code):
http://stackoverflow.com/questions/21785699/bagging-logistic-regression-in-r

Thanks,

Alex



More information about the R-help mailing list