- data
A data frame containing predictors and response.
- formula
A formula specifying the model (e.g., y ~ .).
- model_fn
A function that fits a model. Should accept formula and
data arguments and return a fitted model with a predict method.
Default uses lm.
- predict_fn
A function to generate predictions. Should accept model
and newdata arguments. Default uses predict.
- metric
A character string specifying the metric to compute. One of
"rmse", "mae", "rsq", "auc", "accuracy".
Default: "rmse" for regression, "accuracy" for classification.
- diagnosis
A BorgDiagnosis object. If NULL, will be computed
automatically using the provided structure hints.
- coords
Character vector of length 2 specifying coordinate column names.
- time
Character string specifying the time column name.
- groups
Character string specifying the grouping column name.
- target
Character string specifying the response variable name. If NULL,
extracted from formula.
- v
Integer. Number of CV folds. Default: 5.
- repeats
Integer. Number of times to repeat CV. Default: 10 for stable
estimates.
- seed
Integer. Random seed for reproducibility.
- verbose
Logical. Print progress messages. Default: TRUE.