kFoldRun: k-fold cross-validiation for Random Rotation Forests.

Description Usage Arguments Value Author(s) Examples

Description

Performs k-fold cross-validation using specified Random Rotation Forest as prediction model.

Usage

1
kFoldRun(x, y, k = 10, seed = 1, verbose = TRUE, ...)

Arguments

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 RRotF.

Value

A list containing the average CV error computed over the folds and the error per fold.

Author(s)

Arnu Pretorius <arnupretorius@gmail.com>

Examples

 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

arnupretorius/RRotF documentation built on May 10, 2019, 1:46 p.m.