Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mape

Compute mean absolute percentage error


Description

Takes in actual and predicted linear response, and returns MAPE value

Usage

mape(y, yhat)

Arguments

y

actual linear response

yhat

predicted linear response

Details

mape calculates the mean absolute percentage error in a predicted linear response.

Value

mean absolute percentage error

Author(s)

Akash Jain

See Also

Examples

# A 'data.frame' with y and yhat
 df <- data.frame(y = c(1.5, 2, 3.2),
                  yhat = c(3.4, 2.2, 2.7))

# Compute mape
MAPE <- mape(y = df[, 'y'], yhat = df[, 'yhat'])

StatMeasures

Easy Data Manipulation, Data Quality and Statistical Checks

v1.0
GPL-2
Authors
Akash Jain
Initial release
2015-03-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.