R/SL.glmnet.interaction.R
SL.glmnet.interaction.Rd
Penalized regression using elastic net. Alpha = 0 corresponds to ridge regression and alpha = 1 corresponds to Lasso. Included in the model are pairwise interactions between covariates.
See vignette("glmnet_beta", package = "glmnet")
for a nice tutorial on
glmnet.
SL.glmnet.interaction(
Y,
X,
newX,
family,
obsWeights,
id,
alpha = 1,
nfolds = 10,
nlambda = 100,
useMin = TRUE,
loss = "deviance",
...
)
Outcome variable
Covariate dataframe
Dataframe to predict the outcome
"gaussian" for regression, "binomial" for binary classification. Untested options: "multinomial" for multiple classification or "mgaussian" for multiple response, "poisson" for non-negative outcome with proportional mean and variance, "cox".
Optional observation-level weights
Optional id to group observations from the same unit (not used currently).
Elastic net mixing parameter, range [0, 1]. 0 = ridge regression and 1 = lasso.
Number of folds for internal cross-validation to optimize lambda.
Number of lambda values to check, recommended to be 100 or more.
If TRUE use lambda that minimizes risk, otherwise use 1 standard-error rule which chooses a higher penalty with performance within one standard error of the minimum (see Breiman et al. 1984 on CART for background).
Loss function, can be "deviance", "mse", or "mae". If family = binomial can also be "auc" or "class" (misclassification error).
Any additional arguments are passed through to cv.glmnet.