Skip to content

Usage

ref_crossfit(
spec,
data,
outcomes,
folds = 5,
strata = NULL,
cluster = NULL,
id = NULL,
uncertainty = c("conditional", "total"),
n_draw = NULL,
...
)

Every reference observation receives a score from a model that did not include that observation. A final deployment model is then refit on all reference rows.

Argument Description
spec A ref_spec.
data Reference data.
outcomes Outcome selection, as in ref_fit().
folds Number of folds (at least 2).
strata Optional stratification column. Rows with a missing
stratum form a stratum of their own.
cluster Optional cluster / subject column. Entire clusters stay
in one fold.
id Optional identifier stored on scores.
uncertainty Passed to predict.ref_fit() when the held-out
fold is scored, as in ref_assess(). Use "total" to match the
predictive that predict.ref_fit() returns by default, which is
what a map fitted on these scores by ref_calibrate() will be
applied to.
n_draw Number of coefficient draws when uncertainty = "total".
The value is retained as calibration provenance.
... Passed to ref_fit().

A ref_scores object with .in_sample = FALSE, .row indexing rows of data, a per-row crps column, and a .fold column, plus a deployment fit attribute.