Learn R Programming

genscore (version 1.0.2)

make_folds: 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)

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.

Arguments

nsamp

Number of samples.

nfold

Number of cross validation folds.

cv_fold_seed

Seed for random shuffling.

Examples

Run this code
make_folds(37, 5, NULL)
make_folds(100, 5, 2)
make_folds(100, 10, 3)

Run the code above in your browser using DataLab