make_folds: Create cross-validation folds

View source: R/utils.R

make_foldsR Documentation

Create cross-validation folds

Description

Utility function to create folds of data, used in cross-validation proceidures. The implementation is originally from the gbex R package

Usage

make_folds(y, num_folds, stratified = FALSE)

Arguments

y

Numerical vector of observations

num_folds

Number of folds to create.

stratified

Logical value. If TRUE, the folds are stratified along rank(y).

Value

Vector of indices of the assigned folds for each observation.

Examples

make_folds(rnorm(30), 5)

EQRN documentation built on April 4, 2025, 12:45 a.m.