This function does a permutation-based evaluation of the impact of different edges on the final result. It does so by permuting the kernel matrices, refitting the model and calculating a loss function.
permtest(x, ...)# S3 method for permtest
print(x, digits = max(3L, getOption("digits") - 3), ...)
# S4 method for tskrrHeterogeneous
permtest(
x,
n = 100,
permutation = c("both", "row", "column"),
exclusion = c("interaction", "row", "column", "both"),
replaceby0 = FALSE,
fun = loss_mse,
exact = FALSE
)
# S4 method for tskrrHomogeneous
permtest(
x,
n = 100,
permutation = c("both"),
exclusion = c("interaction", "both"),
replaceby0 = FALSE,
fun = loss_mse,
exact = FALSE
)
# S4 method for tskrrTune
permtest(x, permutation = c("both", "row", "column"), n = 100)
either a tskrr-class
or a
tskrrTune-class
object
arguments passed to other methods
the number of digits shown in the output
the number of permutations for every kernel matrix
a character string that defines whether the row, column or both kernel matrices should be permuted. Ignored in case of a homogeneous network
the exclusion to be used in the loo
function. See also get_loo_fun
a logical value indicating whether loo
removes a value in the leave-one-out procedure or replaces it by zero.
See also get_loo_fun
.
a function (or a character string with the name of a
function) that calculates the loss. See also tune
and
loss_functions
a logical value that indicates whether or not an exact p-value should be calculated, or be approximated based on a normal distribution.
An object of the class permtest.
It should be noted that this normal approximation is an ad-hoc approach. There's no guarantee that the actual distribution of the loss under the null hypothesis is normal. Depending on the loss function, a significant deviation from the theoretic distribution can exist. Hence this functions should only be used as a rough guidance in model evaluation.
The test involved uses a normal approximation. It assumes that under the null hypothesis, the loss values are approximately normally distributed. The cumulative probability of a loss as small or smaller than the one found in the original model, is calculated based on a normal distribution from which the mean and sd are calculated from the permutations.
# NOT RUN {
# Heterogeneous network
data(drugtarget)
mod <- tskrr(drugTargetInteraction, targetSim, drugSim)
permtest(mod, fun = loss_auc)
# }
Run the code above in your browser using DataLab