Learn R Programming

scorer (version 0.2.0)

pe: Calculate percent error between actual and forecast.

Description

pe takes actual and forecast numeric vectors and returns a numeric vector where forecast is subtracted from the actual and then those errors are divided by the actuals.

Usage

pe(y_true = NULL, y_pred = NULL, actual = NULL, forecast = NULL)

Arguments

y_true
Ground truth (correct) target values.
y_pred
Estimated target values.
actual
a numeric vector of actuals.
forecast
a numeric vector of forecasts.

Value

a numeric vector of percent errors.

Examples

Run this code
# Examples
pe(1:100, 100:1)

Run the code above in your browser using DataLab