Function to check validy of provided loss function

check_loss(loss.type, loss.gradient, Y = NULL, model = NULL)

Arguments

loss.type

character, list or function.

character

Name of the loss to be applied ('square', 'absolute', 'percentage', or 'pinball');

list

When using pinball loss: list with field name equal to 'pinball' and field tau equal to the required quantile in [0,1];

function

A custom loss as a function of two parameters.

loss.gradient

boolean, function.

boolean

If TRUE, the aggregation rule will not be directly applied to the loss function at hand, but to a gradient version of it. The aggregation rule is then similar to gradient descent aggregation rule.

function

If loss.type is a function, the derivative should be provided to be used (it is not automatically computed).

Y

numeric (NULL). (Optional) Target values (to perform some checks).

model

character (NULL). (Optional) Model used (to perform some checks).

Value

loss.type