make_folds: Helper function for making fold IDs for cross validation.

Description Usage Arguments Value Examples

View source: R/genscore.R

Description

Helper function for making fold IDs for cross validation.

Usage

1
make_folds(nsamp, nfold, cv_fold_seed)

Arguments

nsamp

Number of samples.

nfold

Number of cross validation folds.

cv_fold_seed

Seed for random shuffling.

Value

A list of nsamp vectors, numbers 1 to nsamp shuffled and grouped into vectors of length floor(nsamp/nfold) followed by vectors of length floor(nsamp/nfold)+1.

Examples

1
2
3
make_folds(37, 5, NULL)
make_folds(100, 5, 2)
make_folds(100, 10, 3)

genscore documentation built on April 28, 2020, 1:06 a.m.