mape: Mean Absolute Percentage Error

View source: R/objective_function.R

mapeR Documentation

Mean Absolute Percentage Error

Description

Calculate the MAPE value between predicted and actual values. Can't be used if the actual values contain 0 value.

Usage

mape(preds, actuals)

Arguments

preds

A numeric vector of predicted values.

actuals

A numeric vector of actual (true) values.

Value

MAPE value (percentage).

Examples

preds <- c(80, 120, 180)
actuals <- c(95, 115, 177)
mape(preds, actuals)


metaSVR documentation built on Aug. 21, 2025, 5:58 p.m.