Learn R Programming

MetricsWeighted (version 0.1.0)

mae: Mean absolute error

Description

Weighted mean absolute error of predicted values.

Usage

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

Arguments

actual

Observed values.

predicted

Predicted values.

w

Optional case weights.

...

Further arguments passed to weighted_mean.

Value

A numeric vector of length one.

Examples

Run this code
# NOT RUN {
mae(1:10, (1:10)^2)
mae(1:10, (1:10)^2, w = rep(1, 10))
mae(1:10, (1:10)^2, w = 1:10)
# }

Run the code above in your browser using DataLab