Assert that an object is a forecast object (i.e. a data.table
with a class
forecast
and an additional class forecast_<type>
corresponding to the
forecast type).
See the corresponding assert_forecast_<type>
functions for more details on
the required input formats.
# S3 method for forecast_binary
assert_forecast(forecast, forecast_type = NULL, verbose = TRUE, ...)# S3 method for forecast_point
assert_forecast(forecast, forecast_type = NULL, verbose = TRUE, ...)
# S3 method for forecast_quantile
assert_forecast(forecast, forecast_type = NULL, verbose = TRUE, ...)
# S3 method for forecast_sample
assert_forecast(forecast, forecast_type = NULL, verbose = TRUE, ...)
assert_forecast(forecast, forecast_type = NULL, verbose = TRUE, ...)
# S3 method for default
assert_forecast(forecast, forecast_type = NULL, verbose = TRUE, ...)
Returns NULL
invisibly.
A forecast object (a validated data.table with predicted and observed values).
(optional) The forecast type you expect the forecasts
to have. If the forecast type as determined by scoringutils
based on the
input does not match this, an error will be thrown. If NULL
(the
default), the forecast type will be inferred from the data.
Logical. If FALSE
(default is TRUE
), no messages and
warnings will be created.
Currently unused. You cannot pass additional arguments to scoring
functions via ...
. See the Customising metrics section below for
details on how to use purrr::partial()
to pass arguments to individual
metrics.
forecast <- as_forecast_binary(example_binary)
assert_forecast(forecast)
Run the code above in your browser using DataLab