View source: R/multi_window_metrics.R
| compute_multi_window_metrics | R Documentation |
A single aggregate score hides where a model actually fails – it can
look strong on the full training range while drifting badly over the
most recent months. Scores Train / Last 6 Months / Last 2 Years / Test
(held out) using safe_compute_metrics(), skipping windows the series
is too short to contain rather than reporting them as NA.
compute_multi_window_metrics(forecast_df, train_df, test_df, date_agg = "day")
forecast_df |
A tibble with |
train_df |
A tibble with |
test_df |
A tibble with |
date_agg |
Aggregation frequency (currently unused directly, kept for interface consistency with the rest of the package). |
A tibble with columns Set, Metric, Value – one block per
window that applied.
ds <- as.Date("2024-01-01") + 0:29
train_df <- tibble::tibble(ds = ds[1:20], y = 1:20)
test_df <- tibble::tibble(ds = ds[21:30], y = 21:30)
forecast_df <- tibble::tibble(ds = ds, yhat = 1:30 + 0.5)
compute_multi_window_metrics(forecast_df, train_df, test_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.