Description Usage Arguments Value Examples
Requires the dependent and response values (data frames), the number of predictor variables to use in each rotation, the number of trees to train, and a logical for determining if progress should be printed
1 | rotationForest(xdf, ydf, npredictor, ntree = 10, verbose = F, ...)
|
xdf |
a data frame of X dependent vectors |
ydf |
a data frame of Y response values |
npredictor |
the number of predictor variables that are to be used in each rotation |
ntree |
the number of trees that are to be used to train the ensemble |
verbose |
a logical, set true for classification output to be printed |
... |
extra variables to be passed on to the rpart function |
an object of class rotationForest
1 2 3 4 5 6 7 8 9 10 | fpath <- system.file("extdata", "balance-scale.data", package="rotationForest")
data <- read.table(fpath, sep = ",", header = FALSE)
data.dependent <- data[,-1]
data.response <- data[,1]
data.response <- as.factor(data.response)
total <- data.frame(data.response, data.dependent)
groups <- sample(rep(1:10, times = ceiling(nrow(total) / 19)), size = nrow(total), replace = TRUE)
data.train <- total[!groups %in% 1,]
data.test <- total[groups %in% 1,]
fit <- rotationForest(data.train[,-1], data.train[,1], 2, 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.