loss: Calculate or extract the loss of a tskrr model
Description
This function allows calculating the loss of a tskrr model using
either one of the functions defined in loss_functions
or a custom user function. If the model inherits from class
tskrrTune and no additional arguments
are given, the loss is returned for the settings used when tuning.
The function can also be used to extract the original loss from a
permtest object.
extra arguments passed to the loss function in fun.
fun
a function to be used for calculating the loss. This
can also be a character value giving the name of one of the loss
functions provided in the package
exclusion
a character value with possible values "interaction",
"row", "column" or "both".
See also loo for more information.
replaceby0
a logical value indicating whether the interaction
should be simply removed (FALSE) or replaced by 0 (TRUE).
predictions
a logical value to indicate whether the
predictions should be used instead of leave one out crossvalidation.
If set to TRUE, the other arguments are ignored.
# NOT RUN {data(drugtarget)
mod <- tskrr(drugTargetInteraction, targetSim, drugSim)
loss(mod, fun = loss_auc)
tuned <- tune(mod, fun = loss_auc)
loss(tuned)
loss(tuned, fun = loss_mse)
# }