tskrr: Fitting a two step kernel ridge regression

Description Usage Arguments Value See Also Examples

View source: R/tskrr.R

Description

tskrr is the primary function for fitting a two-step kernel ridge regression model. It can be used for both homogeneous and heterogeneous networks.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
tskrr(
  y,
  k,
  g = NULL,
  lambda = 1e-04,
  testdim = TRUE,
  testlabels = TRUE,
  symmetry = c("auto", "symmetric", "skewed"),
  keep = FALSE
)

Arguments

y

a label matrix

k

a kernel matrix for the rows

g

an optional kernel matrix for the columns

lambda

a numeric vector with one or two values for the hyperparameter lambda. If two values are given, the first one is used for the k matrix and the second for the g matrix.

testdim

a logical value indicating whether symmetry and the dimensions of the kernel(s) should be tested. Defaults to TRUE, but for large matrices putting this to FALSE will speed up the function.

testlabels

a logical value indicating wether the row- and column names of the matrices have to be checked for consistency. Defaults to TRUE, but for large matrices putting this to FALSE will speed up the function.

symmetry

a character value with the possibilities "auto", "symmetric" or "skewed". In case of a homogeneous fit, you can either specify whether the label matrix is symmetric or skewed, or you can let the function decide (option "auto").

keep

a logical value indicating whether the kernel hat matrices should be stored in the model object. Doing so makes the model object quite larger, but can speed up predictions in some cases. Defaults to FALSE.

Value

a tskrr object

See Also

response, fitted, get_eigen, eigen2hat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Heterogeneous network

data(drugtarget)

mod <- tskrr(drugTargetInteraction, targetSim, drugSim)

Y <- response(mod)
pred <- fitted(mod)

# Homogeneous network

data(proteinInteraction)

modh <- tskrr(proteinInteraction, Kmat_y2h_sc)

Yh <- response(modh)
pred <- fitted(modh)

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