MAPE: Mean Absolute Percentage Error Loss

Description Usage Arguments Value Examples

View source: R/Regression.R

Description

Compute the mean absolute percentage error regression loss.

Usage

1
MAPE(y_pred, y_true)

Arguments

y_pred

Estimated target values vector

y_true

Ground truth (correct) target values vector

Value

Mean Absolute Percentage Error Loss

Examples

1
2
3
data(cars)
reg <- lm(log(dist) ~ log(speed), data = cars)
MAPE(y_pred = exp(reg$fitted.values), y_true = cars$dist)

MLmetrics documentation built on May 20, 2017, 12:52 a.m.

Search within the MLmetrics package
Search all R packages, documentation and source code