Create a scoringutils-ready quantile table from a hubverse table
Source: R/hubverse_to_scorable.R
quantile_table_to_scorable.RdExpects quantile forecast output in hubverse format
(e.g. as created by get_hubverse_quantile_table())
and an observed data table with location, date, and value columns.
The column names in the observed data table can be configured;
defaults are "location", "date", and
"value", respectively.
Usage
quantile_table_to_scorable(
hubverse_quantile_table,
observation_table,
obs_value_column = "value",
obs_date_column = "date",
id_cols = c("location", "target"),
quantile_tol = 10
)Arguments
- hubverse_quantile_table
quantile forecasts, as a hubverse-format
tibble, e.g. as produced byget_hubverse_quantile_table(), with columns includinglocation,target_end_date,output_type,output_type_id, andvalue.- observation_table
observations, as a
tibble.- obs_value_column
Name of the column containing observed values in the
observedtable, as a string. Default"value"- obs_date_column
Name of the column containing date values in the
observedtable, as a string. Default"date".- id_cols
Additional id columns for joining the
observation tableto thehubverse_quantile_table. Passed tohubverse_table_with_obs(). Defaultc("location", "target").- quantile_tol
Round quantile level values to this many decimal places, to avoid problems with floating point number equality comparisons. Passed as the
digitsargument tobase::round(). Default 10.
Value
A data.table for scoring,
as the output of scoringutils::as_forecast_quantile().