MAPE: Mean absolute percentage error

Description Usage Arguments Examples

View source: R/measures_regression.R

Description

Defined as the abs(truth_i - response_i) / truth_i. Won't work if any truth value is equal to zero. In this case the output will be NA.

Usage

1
MAPE(truth, response)

Arguments

truth

[numeric] vector of true values

response

[numeric] vector of predicted values

Examples

1
2
3
4
5
n = 20
set.seed(123)
truth = rnorm(n)
response = rnorm(n)
MAPE(truth, response)

measures documentation built on Jan. 19, 2021, 5:08 p.m.