View source: R/train_model_glmnet.R
train_model_glmnet | R Documentation |
Training a glmnet model for binomial prediction.
train_model_glmnet(
data,
variable_colname,
alpha = 1,
type.measure = "mse",
type = "response",
standardize = FALSE,
cutOff = 0.5,
nfolds = 10,
...
)
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 |
Generates a glmnet model.
model <- train_model_glmnet(data, variable_colname = "disease", alpha = 0.5, cutOff = 0.5, nfolds = ncol(data)) # LOOCV Elastic net regularization
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.