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

View source: R/genscore.R

make_foldsR Documentation

Helper function for making fold IDs for cross validation.

Description

Helper function for making fold IDs for cross validation.

Usage

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

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

genscore documentation built on May 29, 2024, 9 a.m.