train_model_glmnet: Training a glmnet model for binomial prediction.

Description Usage Arguments Value Examples

View source: R/train_model_glmnet.R

Description

Training a glmnet model for binomial prediction.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
train_model_glmnet(
  data,
  variable_colname,
  alpha = 1,
  type.measure = "mse",
  type = "response",
  standardize = FALSE,
  cutOff = 0.5,
  nfolds = 10,
  ...
)

Arguments

data

expression data with genes in rows and samples in columns.

variable_colname

Column name for binary class.

alpha

Default = 1 for Lasso penalty. 0 = Ridge penalty. between 0 - 1 = Elastic net. See ?cv.glmnet.

type.measure

See ?cv.glmnet.

type

term for internal prediction type.

standardize

Default = FALSE. Expects data to be pre-scaled. if not, glmnet will do it for you.

cutOff

value for internal prediction.

nfolds

number of folds for cross validation. use ncol(data) for LOOCV.

...

pass to glmnet

Value

Generates a glmnet model.

Examples

1
model <- train_model_glmnet(data, variable_colname = "disease", alpha = 0.5, cutOff = 0.5, nfolds = ncol(data)) # LOOCV Elastic net regularization

zktuong/kelvinny documentation built on Oct. 22, 2020, 1:27 p.m.