Learn R Programming

scoringutils (version 0.1.4)

range_plot: Plot Metrics by Range of the Prediction Interval

Description

Visualise the metrics by range, e.g. if you are interested how different interval ranges contribute to the overal interval score, or how sharpness changes by range.

Usage

range_plot(
  scores,
  y = "interval_score",
  x = "model",
  colour = "range",
  xlab = x,
  ylab = y
)

Arguments

scores

A data.frame of scores based on quantile forecasts as produced by eval_forecasts. Note that "range" must be included in the summarise_by argument when running eval_forecasts

y

The variable from the scores you want to show on the y-Axis. This could be something like "interval_score" (the default) or "sharpness"

x

The variable from the scores you want to show on the x-Axis. Usually this will be "model"

colour

Charachter vector of length one used to determine a variable for colouring dots. The Default is "range".

xlab

Label for the x-axis. Default is the variable name on the x-axis

ylab

Label for the y-axis. Default is "WIS contributions"

Value

A ggplot2 object showing a contributions from the three components of the weighted interval score

Examples

Run this code
# NOT RUN {
scores <- scoringutils::eval_forecasts(scoringutils::quantile_example_data_long,
                                       by = c("model", "id", "horizon"),
                                       summarise_by = c("model", "horizon", "range"))
scoringutils::range_plot(scores, x = "model")

scoringutils::range_plot(scores, y = "sharpness", x = "model")
# }

Run the code above in your browser using DataLab