Fit GLMnet models via a formula and a data set for use with predictRisk
.
GLMnet(
formula,
data,
lambda = NULL,
cv = TRUE,
alpha = 1,
nfolds = 10,
type.measure = "deviance",
family,
...
)
A formula.
The data on which to fit the model.
The tuning parameters for GLMnet. If set to NULL, then it the parameters are chosen for you.
Whether to use cross-validation or not. Default is TRUE.
The elasticnet mixing parameter. See the ?glmnet for more details.
Number of folds for cross-validation. Default is 10.
loss to use for cross-validation. Default is deviance.
passed to glmnet
. Defaults for binary outcome to "binomial"
and for survival to "cox"
.
Additional arguments that are passed on to the glmnet.