plot.training_results: Plot an object of class training_results

Description Usage Arguments Value

View source: R/train_model.R

Description

Several diagnostic plots can be returned to assess the quality of the forecasts based on predictions on the validation datasets.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## S3 method for class 'training_results'
plot(
  x,
  type = c("prediction", "residual", "forecast_stability"),
  facet = horizon ~ model,
  models = NULL,
  horizons = NULL,
  windows = NULL,
  valid_indices = NULL,
  group_filter = NULL,
  keep_missing = FALSE,
  ...
)

Arguments

x

An object of class 'training_results' from predict.forecast_model().

type

Plot type. The default plot is "prediction" for validation dataset predictions.

facet

Optional. For numeric outcomes, a formula with any combination of horizon, model, or group (for grouped time series) passed to ggplot2::facet_grid() internally (e.g., horizon ~ model, horizon + model ~ ., ~ horizon + group).

models

Optional. Filter results by user-defined model name from train_model().

horizons

Optional. A numeric vector of model forecast horizons to filter results by horizon-specific model.

windows

Optional. A numeric vector of window numbers to filter results.

valid_indices

Optional. A numeric or date vector to filter results by validation row indices or dates.

group_filter

Optional. A string for filtering plot results for grouped time series (e.g., "group_col_1 == 'A'"). The results are passed to dplyr::filter() internally.

keep_missing

Boolean. If TRUE, predictions are plotted for indices/dates where the outcome is missing.

...

Not used.

Value

Diagnostic plots of class 'ggplot'.


forecastML documentation built on July 8, 2020, 7:27 p.m.