bagging {autoBagging} | R Documentation |
bagging method
Description
bagging method
Usage
bagging(form, data, ntrees, pruning, dselection, pruning_cp)
Arguments
form |
formula |
data |
training data |
ntrees |
ntrees |
pruning |
model pruning method. A character vector. Currently, the following methods are supported:
|
dselection |
dynamic selection of the available models. Currently, the following methods are supported:
|
pruning_cp |
The pruning cutpoint for the |
See Also
baggedtrees
for the implementation of the bagging model.
Examples
# splitting an example dataset into train/test:
train <- iris[1:(.7*nrow(iris)), ]
test <- iris[-c(1:(.7*nrow(iris))), ]
form <- Species ~.
# a user-defined bagging workflow
m <- bagging(form, iris, ntrees = 5, pruning = "bb", pruning_cp = .5, dselection = "ola")
preds <- predict(m, test)
# a standard bagging workflow with 5 trees (5 trees for examplification purposes):
m2 <- bagging(form, iris, ntrees = 5, pruning = "none", dselection = "none")
preds2 <- predict(m2, test)
[Package autoBagging version 0.1.0 Index]