plot_model_comparison: Overlay several models' forecasts on one plot

View source: R/plot_generic.R

plot_model_comparisonR Documentation

Overlay several models' forecasts on one plot

Description

Used for the "Compare Selected Models" flow (and forecast ensembling, which adds one more named entry).

Usage

plot_model_comparison(forecasts, train_df = NULL, title = "Model Comparison")

Arguments

forecasts

A named list of ds/yhat tibbles; names are used as the legend labels.

train_df

Optional tibble with ds/y columns, drawn as the "Actual" line.

title

Character scalar, the plot title. Default "Model Comparison".

Value

A plotly htmlwidget.

Examples

ds <- as.Date("2024-01-01") + 0:9
forecasts <- list(
  ARIMA = tibble::tibble(ds = ds, yhat = 1:10),
  ETS = tibble::tibble(ds = ds, yhat = 1:10 + 1)
)
plot_model_comparison(forecasts)

forecastsuite documentation built on Oct. 18, 2026, 5:08 p.m.