Skip to contents

Regenerates predictions.parquet from the per-cutoff run_MOSAIC directories under a run_rolling_cv() artifact (e.g. after adding a cutoff or to add quantile columns), without recalibrating.

Usage

compile_rolling_cv_predictions(
  dir_output,
  base_config = MOSAIC::config_default,
  models = NULL,
  n_reps_best_medoid = NULL,
  central_method = NULL,
  write = TRUE
)

Arguments

dir_output

A run_rolling_cv() output directory (must contain manifest.json and runs/); a manifest from an interrupted run (status = "running") compiles the cutoffs it records.

base_config

Config used to recover the held-out (unmasked) observed series (default MOSAIC::config_default); must match the run config.

models

Character vector of model types to compile, from "ensemble", "ensemble_opt", "best", "medoid"; NULL (default) uses the set recorded in the run manifest.

n_reps_best_medoid

Integer or NULL (default); number of stochastic replicates to draw for the single-config best/medoid models, with each cutoff run's observation model and deaths integration (see run_rolling_cv). NULL reuses the value stored in the run manifest.

central_method

Central tendency for pred_central: NULL (default) reuses the value recorded in the run manifest; a manifest without the field was written by run_rolling_cv() before central_method existed (v0.32.40-v0.37.x), when predictions were the ensemble median, so it recompiles on "median". Otherwise a scalar or per-channel c(cases=, deaths=) override.

write

Logical; write predictions.parquet (default TRUE).

Value

The compiled long predictions data frame (invisibly if written).