Skip to contents

Trains and tests prediction models

Usage

traintest(
  y_train,
  X_train,
  y_test = NULL,
  X_test = NULL,
  family,
  alpha,
  method = c("glm.separate", "glm.glmtrans", "sparselink", "glm.common"),
  alpha.init,
  type,
  trial = FALSE
)

Arguments

y_train

target of training samples: vector of length n

X_train

features of training samples: \(n \times p\) matrix

y_test

target of testing samples: vector of length \(m\)

X_test

features of testing samples \(m \times p\) matrix

family

character "gaussian" or "binomial"

alpha

elastic net mixing parameter

method

character vector

alpha.init

elastic net mixing parameter for initial regressions

type

character

trial

see sparselink