Description Usage Arguments Value Author(s) Examples
Performs k-fold cross-validation using specified Random Rotation Forest as prediction model.
1 |
x |
Training data input matrix. |
y |
Training data response. |
k |
Number of folds. |
seed |
Specified seed for reproducible folds. |
verbose |
Boolean, if true prints progress of k-fold CV runs, if false prints nothing. |
... |
Additional arguments specified to |
A list containing the average CV error computed over the folds and the error per fold.
Arnu Pretorius <arnupretorius@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 | 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]
CVerror <- kFoldRun(Xtrain, ytrain, k=5)
CVerror
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.