k-fold cross validation, a splitFunction in the sense of vtreat::buildEvalSets

kWayCrossValidation(nRows, nSplits, dframe, y)

Arguments

nRows

number of rows to split (>1).

nSplits

number of groups to split into (>1,<=nRows).

dframe

original data frame (ignored).

y

numeric outcome variable (ignored).

Value

split plan

Examples

kWayCrossValidation(7,2,NULL,NULL)
#> [[1]] #> [[1]]$train #> [1] 2 4 5 6 #> #> [[1]]$app #> [1] 7 1 3 #> #> #> [[2]] #> [[2]]$train #> [1] 1 3 7 #> #> [[2]]$app #> [1] 6 2 5 4 #> #> #> attr(,"splitmethod") #> [1] "kwaycross"