Skip to contents

This function calculates the Mean Absolute Error (MAE) for a set of forecasts and corresponding true values.

Usage

score_MAE(
  forecast_data,
  truth,
  ingest = c("dataframe", "path", "list"),
  missing = c("remove", "zero")
)

Arguments

forecast_data

A dataframe, path or list object containing forecast information

truth

A dataframe containing true values to compare forecasts against

ingest

Character value indicating how forecast data is being passed. Options are "dataframe", "path", or "list". Default is "dataframe".

missing

Character value indicating how to handle missing or NaN values in the truth data. Options are "remove" or "zero". If "remove", any data points with missing true values will be removed from calculation. If "zero", any data points with missing true values will be assumed to have a true value of 0. Default is "remove".

Value

Returns a data frame with columns for Model, MAE, MAPE, and Rank, sorted by ascending order of MAE.

Examples

score_MAE(forecast_data = my_forecasts, truth = my_truth, ingest = "dataframe", missing = "remove")
#> Error in score_MAE(forecast_data = my_forecasts, truth = my_truth, ingest = "dataframe",     missing = "remove"): object 'my_forecasts' not found