kfoldind: Sampling for k-fold validation

Description Usage Arguments Details Value Examples

View source: R/scripts.R

Description

Sampling for k-fold validation

Usage

1
kfoldind(ndata, k = 5, repetitions = 3)

Arguments

ndata

the number of rows in the data. If a vector is given, will use the length. If a matrix or a dataframe is given, will use number of rows.

k

number of folds, positive integer.

repetitions

number of repetitions of the k-fold procedure, positive integer.

Details

Setting k=1 is understood as no folding: returned training and validation subsets will be both the full set.

Value

a list of k*repetitions components, each of which is a list of two vectors: indices of the training subset and of the validation subset.

Examples

1
#

rushkin/bitsandends documentation built on Oct. 21, 2020, 11:43 a.m.