Learn R Programming

scoringutils (version 0.1.4)

score_heatmap: Create a Heatmap of a Scoring Metric

Description

This function can be used to create a heatmap of one metric across different groups, e.g. the interval score obtained by several forecasting models in different locations.

Usage

score_heatmap(scores, y = "model", x, metric, ylab = y, xlab = x)

Arguments

scores

A data.frame of scores based on quantile forecasts as produced by eval_forecasts.

y

The variable from the scores you want to show on the y-Axis. The default for this is "model"

x

The variable from the scores you want to show on the x-Axis. This could be something like "horizon", or "location"

metric

the metric that determines the value and colour shown in the tiles of the heatmap

ylab

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

xlab

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

Value

A ggplot2 object showing a heatmap of the desired metric

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"))

scoringutils::score_heatmap(scores, x = "horizon", metric = "bias")

# }

Run the code above in your browser using DataLab