Free Access Week-  Data Engineering + BI
Data engineering and BI courses are free!
Free AI Access Week from June 2-8

MetricsWeighted (version 1.0.0)

mape: Mean Absolute Percentage Error

Description

Calculates weighted mean absolute percentage error of predicted values. The smaller, the better.

Usage

mape(actual, predicted, w = NULL, ...)

Value

A numeric vector of length one.

Arguments

actual

Strictly positive observed values.

predicted

Predicted values.

w

Optional case weights.

...

Further arguments passed to weighted_mean().

Examples

Run this code
mape(1:10, c(1:9, 12))
mape(1:10, c(1:9, 12), w = 1:10)

Run the code above in your browser using DataLab