Skip to contents

Construct cross-fitting folds

Usage

dr_folds(n, V = 5L, seed = 1L)

Arguments

n

Integer sample size.

V

Number of folds.

seed

RNG seed for reproducible fold assignment.

Value

An integer vector of length n with fold ids in 1:V.

Examples

table(dr_folds(20, V = 5))
#> 
#> 1 2 3 4 5 
#> 4 4 4 4 4