plot_heatmap | R Documentation |
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.
plot_heatmap(scores, y = "model", x, metric)
scores |
A data.frame of scores based on quantile forecasts as
produced by |
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 |
String, the metric that determines the value and colour shown in the tiles of the heatmap. |
A ggplot object showing a heatmap of the desired metric
library(magrittr) # pipe operator
scores <- example_quantile %>%
as_forecast_quantile %>%
score()
scores <- summarise_scores(scores, by = c("model", "target_type"))
scores <- summarise_scores(
scores, by = c("model", "target_type"),
fun = signif, digits = 2
)
plot_heatmap(scores, x = "target_type", metric = "bias")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.