permtest: Calculate the relative importance of the edges

Description Usage Arguments Details Value Warning Examples

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
permtest(x, ...)

## S3 method for class 'permtest'
print(x, digits = max(3L, getOption("digits") - 3), ...)

## S4 method for signature '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 signature 'tskrrHomogeneous'
permtest(
  x,
  n = 100,
  permutation = c("both"),
  exclusion = c("interaction", "both"),
  replaceby0 = FALSE,
  fun = loss_mse,
  exact = FALSE
)

## S4 method for signature 'tskrrTune'
permtest(x, permutation = c("both", "row", "column"), n = 100)

Arguments

x

either a tskrr-class or a tskrrTune-class object

...

arguments passed to other methods

digits

the number of digits shown in the output

n

the number of permutations for every kernel matrix

permutation

a character string that defines whether the row, column or both kernel matrices should be permuted. Ignored in case of a homogeneous network

exclusion

the exclusion to be used in the loo function. See also get_loo_fun

replaceby0

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.

fun

a function (or a character string with the name of a function) that calculates the loss. See also tune and loss_functions

exact

a logical value that indicates whether or not an exact p-value should be calculated, or be approximated based on a normal distribution.

Details

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.

Value

An object of the class permtest.

Warning

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.

Examples

1
2
3
4
5
6
# Heterogeneous network

data(drugtarget)

mod <- tskrr(drugTargetInteraction, targetSim, drugSim)
permtest(mod, fun = loss_auc)

xnet documentation built on Feb. 4, 2020, 9:10 a.m.