Learn R Programming

modeltime (version 0.4.0)

default_forecast_accuracy_metric_set: Forecast Accuracy Metrics Sets

Description

This is a wrapper for metric_set() with several common forecast / regression accuracy metrics included. These are the default time series accuracy metrics used with modeltime_accuracy().

Usage

default_forecast_accuracy_metric_set()

Arguments

Details

The primary purpose is to use the default accuracy metrics to calculate the following forecast accuracy metrics using modeltime_accuracy():

  • MAE - Mean absolute error, mae()

  • MAPE - Mean absolute percentage error, mape()

  • MASE - Mean absolute scaled error, mase()

  • SMAPE - Symmetric mean absolute percentage error, smape()

  • RMSE - Root mean squared error, rmse()

  • RSQ - R-squared, rsq()

Examples

Run this code
# NOT RUN {
library(tibble)
library(dplyr)
library(timetk)

set.seed(1)
data <- tibble(
    time  = tk_make_timeseries("2020", by = "sec", length_out = 10),
    y     = 1:10 + rnorm(10),
    y_hat = 1:10 + rnorm(10)
)

# Default Metric Specification
default_forecast_accuracy_metric_set()

# Create a metric summarizer function from the metric set
calc_default_metrics <- default_forecast_accuracy_metric_set()

# Apply the metric summarizer to new data
calc_default_metrics(data, y, y_hat)

# }

Run the code above in your browser using DataLab