Learn R Programming

Laurae (version 0.0.0.9001)

loss_MAE_grad: Mean Absolute Error (gradient function)

Description

This function computes the Mean Absolute Error loss (MAE) gradient per value provided preds and labels.

Usage

loss_MAE_grad(y_pred, y_true)

Arguments

y_pred
The predictions.
y_true
The labels.

Value

The gradient of the Absolute Error per value.

Details

Supposing: \(x = preds - labels\) Loss Formula : \(abs(x)\) Gradient Formula : \(sign(x)\) Hessian Formula : \(0\)