Skip to contents

Function for reproducing hold-out method (simulation) and \(k\)-fold cross-validation (application). See vignette.

Usage

compare(
  target,
  source = NULL,
  prior = NULL,
  z = NULL,
  family,
  alpha,
  scale = "iso",
  sign = FALSE,
  switch = FALSE,
  select = TRUE,
  foldid.ext = NULL,
  nfolds.ext = 10,
  foldid.int = NULL,
  nfolds.int = 10,
  type.measure = "deviance",
  alpha.prior = NULL,
  naive = TRUE,
  seed = NULL,
  cores = 1,
  xrnet = FALSE
)

Arguments

target

list with slot x (feature matrix with n rows and p columns) and slot y (target vector of length n)

source

list of k lists, each with slot x (feature matrix with m_i rows and p columns) and slot y (target vector of length m_i)

prior

prior coefficients: matrix with \(p\) rows (features) and \(k\) columns (sources of co-data)

z

prior weights

family

character "gaussian" (\(y\): real numbers), "binomial" (\(y\): 0s and 1s), or "poisson" (\(y\): non-negative integers);

alpha

elastic net mixing parameter (0=ridge, 1=lasso): number between 0 and 1

scale

character "exp" for exponential calibration or "iso" for isotonic calibration

sign

sign discovery procedure: logical (experimental argument)

switch

choose between positive and negative weights for each source: logical

select

select from sources: logical

foldid.ext

external fold identifiers

nfolds.ext

number of external folds

foldid.int

internal fold identifiers

nfolds.int

number of internal folds

type.measure

character

alpha.prior

alpha for source regression

naive

compare with naive transfer learning: logical

seed

random seed

cores

number of cores for parallel computing (requires R package doMC)

xrnet

compare with xrnet: logical

See also