train_model_glmnet: Training a glmnet model for binomial prediction.

View source: R/train_model_glmnet.R

train_model_glmnetR Documentation

Training a glmnet model for binomial prediction.

Description

Training a glmnet model for binomial prediction.

Usage

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

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 July 18, 2024, 10:42 a.m.