Learn R Programming

modello (version 0.1.1)

mae.modello_number: Mean Absolute Error

Description

Calculates the mean absolute error between target values and predictions $$mae = \sum_i^N{|y_i - \hat y_i|} / N$$

Usage

# S3 method for modello_number
mae(y, yh)

# S3 method for default mae(y, yh)

mae(y, yh)

Arguments

y

target values

yh

predictions

Value

Returns the mse

Examples

Run this code
# NOT RUN {
modello.init(10, 10, 10, 10)
## For modello_numbers
y = number(rnorm(10), dx=FALSE)
yh = number(rnorm(10), dx=FALSE)
h = mae(y, yh)
print(h)
print(h$v)
modello.close()
## For numerics
y = rnorm(10)
yh = rnorm(10)
h = mae(y, yh)
print(h)
# }

Run the code above in your browser using DataLab