For each fold (train/test indices):
Subset data[train, ]
Fit a model with .fit_fun(train_data, ...)
Evaluate with .measure_fun(model, test_data, ...)
cv_generic(
data,
folds,
.fit_fun,
.measure_fun,
fit_args = list(),
measure_args = list(),
backend = c("serial", "future"),
...
)A tibble with columns:
integer fold index
list of fitted models
list of metric tibbles/lists
A matrix or data.frame of shape (n x p).
A list of folds, each a list with $train and $test.
Function: signature function(train_data, ...){}. Returns a fitted model.
Function: signature function(model, test_data, ...){}. Returns a tibble or named list/vector of metrics.
A list of additional named arguments passed to .fit_fun.
A list of additional named arguments passed to .measure_fun.
Character string: "serial" (default) or "future" for parallel execution using the future framework.
Currently ignored (arguments should be passed via fit_args or measure_args).