cv: Resampling specification generator.

View source: R/cv.R

cvR Documentation

Resampling specification generator.

Description

Resampling specification generator.

Usage

cv(
  v = 5,
  repeats = 1,
  strata = TRUE,
  seed = NULL,
  method = c("vfold", "holdout", "group_vfold", "time"),
  prop = 0.8,
  group = NULL,
  time = NULL,
  initial = NULL,
  assess = NULL,
  skip = 0,
  cumulative = TRUE
)

Arguments

v

Number of folds for cross-validation.

repeats

Number of repeats for standard or grouped cross-validation.

strata

Logical; stratify classification outcomes when supported.

seed

Optional seed for reproducibility.

method

Resampling strategy: "vfold", "holdout", "group_vfold", or "time".

prop

Training-set proportion for holdout splits.

group

Optional grouping variable name or vector for grouped CV.

time

Optional ordering variable name or vector for time-aware splits.

initial

Initial training window size for time-aware CV.

assess

Assessment window size for time-aware CV.

skip

Number of observations to skip between successive time splits.

cumulative

Logical; use an expanding training window for time-aware CV.

Value

A funcml_cv object containing fold indices and parameters.

Examples

cv(v = 3, repeats = 2, seed = 1)

funcml documentation built on Aug. 22, 2026, 5:08 p.m.