check_forecasts {scoringutils}R Documentation

Check forecasts

Description

Function to check the input data before running score().

The data should come in one of three different formats:

Usage

check_forecasts(data)

Arguments

data

A data.frame or data.table with the predictions and observations. For scoring using score(), the following columns need to be present:

  • true_value - the true observed values

  • prediction - predictions or predictive samples for one true value. (You only don't need to provide a prediction column if you want to score quantile forecasts in a wide range format.)

For scoring integer and continuous forecasts a sample column is needed:

  • sample - an index to identify the predictive samples in the prediction column generated by one model for one true value. Only necessary for continuous and integer forecasts, not for binary predictions.

For scoring predictions in a quantile-format forecast you should provide a column called quantile:

  • quantile: quantile to which the prediction corresponds

In addition a model column is suggested and if not present this will be flagged and added to the input data with all forecasts assigned as an "unspecified model").

You can check the format of your data using check_forecasts() and there are examples for each format (example_quantile, example_continuous, example_integer, and example_binary).

Value

A list with elements that give information about what scoringutils thinks you are trying to do and potential issues.

Author(s)

Nikos Bosse nikosbosse@gmail.com

See Also

Function to move from sample-based to quantile format: sample_to_quantile()

Examples

check <- check_forecasts(example_quantile)
print(check)
check_forecasts(example_binary)

[Package scoringutils version 1.2.2 Index]