View source: R/summarise_scores.R
| summarise_scores | R Documentation |
score()Summarise scores as produced by score().
summarise_scores relies on a way to identify the names of the scores and
distinguish them from columns that denote the unit of a single forecast.
Internally, this is done via a stored attribute, metrics that stores
the names of the scores. This means, however, that you need to be careful
with renaming scores after they have been produced by score(). If you
do, you also have to manually update the attribute by calling
attr(scores, "metrics") <- new_names.
summarise_scores(scores, by = "model", fun = mean, ...)
summarize_scores(scores, by = "model", fun = mean, ...)
scores |
An object of class |
by |
Character vector with column names to summarise scores by. Default is "model", i.e. scores are summarised by the "model" column. |
fun |
A function used for summarising scores. Default is |
... |
Additional parameters that can be passed to the summary function
provided to |
A data.table with summarised scores. Scores are summarised according
to the names of the columns of the original data specified in by
using the fun passed to summarise_scores().
library(magrittr) # pipe operator
scores <- example_sample_continuous %>%
as_forecast_sample() %>%
score()
# get scores by model
summarise_scores(scores, by = "model")
# get scores by model and target type
summarise_scores(scores, by = c("model", "target_type"))
# get standard deviation
summarise_scores(scores, by = "model", fun = sd)
# round digits
summarise_scores(scores, by = "model") %>%
summarise_scores(fun = signif, digits = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.