R/outOfSample.R
kWayCrossValidation.Rd
k-fold cross validation, a splitFunction in the sense of vtreat::buildEvalSets
kWayCrossValidation(nRows, nSplits, dframe, y)
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). |
split plan
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"