Description Usage Arguments Value Author(s) References See Also Examples
Fit a Random Rotation Forest using randomised trees with orthogonal or oblique splits as base learners.
1 2 |
x |
Training data input matrix. |
y |
Training data response. |
K |
The number of variable subsets. The default is the value K that results in three features per subset. |
L |
The number of base classfiers. |
mtry |
Number of variables randomly sampled as candidates at each split. |
model |
Specifies the base learner model: 'rpart' for ordinary classification trees; 'rf' for randomised trees; 'ridge', 'pls', 'log', 'svm' or 'rnd' for randomised trees using oblique splits with the corresponding model. |
... |
Additional arguments specified to |
A fitted model object of type 'RRotF', which is a list containing base learner fits and PCA loadings.
Arnu Pretorius: arnupretorius@gmail.com
Rodriguez, J.J., Kuncheva, L.I., 2006. Rotation forest: A new classifier ensemble method. IEEE Trans. Pattern Anal. Mach. Intell. 28, 1619-1630. doi:10.1109/TPAMI.2006.211
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(ElemStatLearn)
library(caret)
data("SAheart")
trainIndex <- createDataPartition(SAheart$chd, p=0.6, list=FALSE)
train <- SAheart[trainIndex,]
test <- SAheart[-trainIndex,]
Xtrain <- train[,-10]
ytrain <- train[,10]
Xtest <- test[,-10]
ytest <- test[,10]
mod <- RRotF(Xtrain, ytrain, model="log")
preds <- predict(mod, Xtest)
error <- mean(preds != ytest)
error
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.