A convenient plotting function for visualizing resampling accuracy by resample set for each model in a Modeltime Table.
plot_modeltime_resamples(
.data,
.metric_set = default_forecast_accuracy_metric_set(),
.summary_fn = mean,
...,
.facet_ncol = NULL,
.facet_scales = "free_x",
.point_show = TRUE,
.point_size = 1,
.point_shape = 16,
.point_alpha = 1,
.summary_line_show = TRUE,
.summary_line_size = 0.5,
.summary_line_type = 1,
.summary_line_alpha = 1,
.x_intercept = NULL,
.x_intercept_color = "red",
.x_intercept_size = 0.5,
.legend_show = TRUE,
.legend_max_width = 40,
.title = "Resample Accuracy Plot",
.x_lab = "",
.y_lab = "",
.color_lab = "Legend",
.interactive = TRUE
)A modeltime table that includes a column .resample_results containing
the resample results. See modeltime_fit_resamples() for more information.
A yardstick::metric_set() that is used to summarize
one or more forecast accuracy (regression) metrics.
See modeltime::default_forecast_accuracy_metric_set() for defaults.
A single summary function that is applied to aggregate the
metrics across resample sets. Default: mean.
Additional arguments passed to the .summary_fn.
Default: NULL. The number of facet columns.
Default: free_x.
Whether or not to show the individual points for each combination
of models and metrics. Default: TRUE.
Controls the point size. Default: 1.
Controls the point shape. Default: 16.
Controls the opacity of the points. Default: 1 (full opacity).
Whether or not to show the summary lines. Default: TRUE.
Controls the summary line width. Default: 0.5.
Controls the summary line type. Default: 1.
Controls the summary line opacity. Default: 1 (full opacity).
Numeric. Adds an x-intercept at a location (e.g. 0). Default: NULL.
Controls the x-intercept color. Default: "red".
Controls the x-intercept linewidth. Default: 0.5.
Logical. Whether or not to show the legend. Can save space with long model descriptions.
Numeric. The width of truncation to apply to the legend text.
Title for the plot
X-axis label for the plot
Y-axis label for the plot
Legend label if a color_var is used.
Returns either a static (ggplot2) visualization or an interactive (plotly) visualization
See modeltime::default_forecast_accuracy_metric_set() for defaults.
m750_training_resamples_fitted %>%
plot_modeltime_resamples(
.interactive = FALSE
)
Run the code above in your browser using DataLab