Learn R Programming

measures (version 0.3)

MAPE: Mean absolute percentage error

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

MAPE(truth, response)

Arguments

truth

[numeric] vector of true values

response

[numeric] vector of predicted values

Examples

Run this code
# NOT RUN {
n = 20
set.seed(123)
truth = rnorm(n)
response = rnorm(n)
MAPE(truth, response)
# }

Run the code above in your browser using DataLab