bagging: bagging method

Description Usage Arguments See Also Examples

Description

bagging method

Usage

1
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:

mdsq

Margin-distance minimisation

bb

boosting based pruning

none

no pruning

dselection

dynamic selection of the available models. Currently, the following methods are supported:

ola

Overall Local Accuracy

knora-e

K-nearest-oracles-eliminate

none

no dynamic selection. Majority voting is used.

pruning_cp

The pruning cutpoint for the pruning method picked.

See Also

baggedtrees for the implementation of the bagging model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 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)

autoBagging documentation built on May 2, 2019, 7:30 a.m.