| 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:
A format for binary predictions (see example_binary)
A sample-based format for discrete or continuous predictions (see example_continuous and example_integer)
A quantile-based format (see example_quantile)
Usage
check_forecasts(data)
Arguments
data |
A data.frame or data.table with the predictions and observations.
For scoring using
For scoring integer and continuous forecasts a
For scoring predictions in a quantile-format forecast you should provide
a column called
In addition a You can check the format of your data using |
Value
A list with elements that give information about what scoringutils
thinks you are trying to do and potential issues.
-
target_typethe type of the prediction target as inferred from the input: 'binary', if all values intrue_valueare either 0 or 1 and values inpredictionare between 0 and 1, 'discrete' if all true values are integers. and 'continuous' if not. -
prediction_typeinferred type of the prediction. 'quantile', if there is a column called 'quantile', else 'discrete' if all values inpredictionare integer, else 'continuous. -
forecast_unitunit of a single forecast, i.e. the grouping that uniquely defines a single forecast. This is assumed to be all present columns apart from the following protected columns:c("prediction", "true_value", "sample", "quantile","range", "boundary"). It is important that you remove all unnecessary columns before scoring. -
rows_per_forecasta data.frame that shows how many rows (usually quantiles or samples there are available per forecast. If a forecast model has several entries, then there a forecasts with differing numbers of quantiles / samples. -
unique_valuesA data.frame that shows how many unique values there are present per model and column in the data. This doesn't directly show missing values, but rather the maximum number of unique values across the whole data. -
warningsA vector with warnings. These can be ignored if you know what you are doing. -
errorsA vector with issues that will cause an error when runningscore(). -
messagesA verbal explanation of the information provided above.
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)