loo {xnet}R Documentation

Leave-one-out cross-validation for tskrr

Description

Perform a leave-one-out cross-validation for two-step kernel ridge regression based on the shortcuts described in Stock et al, 2018. (http://doi.org/10.1093/bib/bby095).

Usage

loo(x, ...)

## S4 method for signature 'tskrrHeterogeneous'
loo(
  x,
  exclusion = c("interaction", "row", "column", "both"),
  replaceby0 = FALSE
)

## S4 method for signature 'tskrrHomogeneous'
loo(
  x,
  exclusion = c("edges", "vertices", "interaction", "both"),
  replaceby0 = FALSE
)

## S4 method for signature 'linearFilter'
loo(x, replaceby0 = FALSE)

Arguments

x

an object of class tskrr or linearFilter.

...

arguments passed to methods. See Details.

exclusion

a character value with possible values "interaction", "row", "column", "both" for heterogeneous models, and "edges", "vertices", "interaction" or "both" for homogeneous models. Defaults to "interaction". See details.

replaceby0

a logical value indicating whether the interaction should be simply removed (FALSE) or replaced by 0 (TRUE).

Details

The parameter exclusion defines what is left out. The value "interaction" means that a single interaction is removed. In the case of a homogeneous model, this can be interpreted as the removal of the interaction between two edges. The values "row" and "column" mean that all interactions for a row edge resp. a column edge are removed. The value "both" removes all interactions for a row and a column edge.

In the case of a homogeneous model, "row" and "column" don't make sense and will be replaced by "both" with a warning. This can be interpreted as removing vertices, i.e. all interactions between one edge and all other edges. Alternatively one can use "edges" to remove edges and "vertices" to remove vertices. In the case of a homogeneous model, the setting "edges" translates to "interaction", and "vertices" translates to "both". For more information, see Stock et al. (2018).

Replacing by 0 only makes sense when exclusion = "interaction" and the label matrix contains only 0 and 1 values. The function checks whether the conditions are fulfilled and if not, returns an error.

Value

a numeric matrix with the leave-one-out predictions for the model.

Examples

data(drugtarget)

mod <- tskrr(drugTargetInteraction, targetSim, drugSim,
             lambda = c(0.01,0.01))

delta <- loo(mod, exclusion = 'both') - response(mod)
delta0 <- loo(mod, replaceby0 = TRUE) - response(mod)


[Package xnet version 0.1.11 Index]