stratified_crossvalidation_folds: Assignments for stratified crossvalidation

View source: R/common.R

stratified_crossvalidation_foldsR Documentation

Assignments for stratified crossvalidation

Description

This function creates the assignments to perform a stratified crossvalidation. It requires, for each element of the set, a label describing the strata it belongs to. It also requires the number of folds.

Usage

stratified_crossvalidation_folds(strata, folds.num)

Arguments

strata

an array of strata (will be treated as a factor)

folds.num

the number of folds

Details

A warning is triggered if the number of folds is greater than the number of elements of any stratum.

Value

an array, same length as strata, of numbers in the 1:folds.num set


GROAN documentation built on Nov. 28, 2022, 5:07 p.m.