Description Usage Arguments See Also Examples
bagging method
1 |
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 |
baggedtrees
for the implementation of the bagging model.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.