These functions can be used as loss functions in tune.
Currently, two functions are provided: a function calculating the
classic mean squared error (loss_mse) and a function
calculating 1 - AUC (loss_auc).
Usage
loss_mse(Y, LOO, na.rm = FALSE)
loss_auc(Y, LOO)
Arguments
Y
the label matrix with observed responses
LOO
the leave-one-out crossvalidation (or predictions if you
must). This one can be calculated by the function loo.
na.rm
a logical value
Details
The AUC is calculated by sorting the Y matrix based on
the order of the values in the LOO matrix. The false and true
positive rates are calculated solely based on that ordering, which
allows for values in LOO outside the range [0,1]. It's
a naive implementation which is good enough for tuning, but
shouldn't be used as a correct value for 1 - auc in case the
values in LOO are outside the range [0,1].