Function to check validy of provided loss function
check_loss(
loss.type,
loss.gradient,
Y = NULL,
model = NULL,
use_cpp = getOption("opera_use_cpp", default = FALSE)
)
character, list or function
.
Name of the loss to be applied ('square', 'absolute', 'percentage', or 'pinball');
When using pinball loss: list with field name equal to 'pinball' and field tau equal to the required quantile in [0,1];
A custom loss as a function of two parameters.
boolean, function
.
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.
If loss.type is a function, the derivative should be provided to be used (it is not automatically computed).
numeric
(NULL). (Optional) Target values (to perform some checks).
character
(NULL). (Optional) Model used (to perform some checks).
boolean
. Whether or not to use cpp function to increase perf.
loss.type