Description Usage Arguments Value Author(s) References See Also Examples
Prediction of new observations using RRotF model.
1 2 |
object |
An object of class |
newdata |
A data frame with the same predictors as in the training data. |
type |
Type of prediction: 'prob' for probabilities and 'class' for class labels. |
A vector containing either predicted class probabilities or labels.
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.