score_batches: Score realized-vs-forecast performance across weekly output...

View source: R/scoreForecast.R

score_batchesR Documentation

Score realized-vs-forecast performance across weekly output batches

Description

Recursively finds every ⁠asof_week*/epifilter_forecast_next_week.csv⁠ under root_dir and matches each batch's one-week-ahead forecast to the actual case count once it appears as an observed row in a later batch's epifilter_results.csv - i.e. this scores genuine prospective (not in-sample) forecast performance over time.

Usage

score_batches(root_dir, revision = c("first", "latest"))

Arguments

root_dir

path under which to search recursively for asof_week* folders (e.g. "output")

revision

"first" or "latest" - see above

Details

Surveillance case counts are commonly revised between runs as reporting catches up (backfill), so the same (location, time) can legitimately have different case counts across different asof_week batches. This function makes that choice explicit via revision: "first" uses the count as it was first reported (matches classic prospective forecast evaluation); "latest" uses the most complete/least revised count available.

This function is a filesystem helper for scoring output produced by the standalone run_rtforecast.R script's weekly batch folders. If you're using rt_forecast() directly in R (recommended for new code), accumulate a data.frame of your own forecasts/actuals across weeks and use mae(), coverage(), and wis() directly instead.

Value

a data.frame, one row per batch whose forecast has since been realized, with location, time, forecast, actual, and per-point MAE/coverage (95% and 50%) columns.


RtForecastR documentation built on Nov. 25, 2026, 9:09 a.m.