like lasso and ridge, elastic net can also be used for classification by using the deviance instead of the residual sum of squares. This essentially happens automatically in caret if the response variable is a factor.

This is from topepo caret github. However, although I searched the internet. No one one really seems to tell what 'glmnet' really is ? For example, if I do the following, for a binary classication task.

glm_net = train( y ~ . , data = train_set, method = 'glmnet', trControl = fitControl, metric = 'ROC')

What is it really? A logistic regression? And it also come with lasso and ridge regression regularization, but it cant be linear regression because it is classification..

  • 1
    $\begingroup$ GLMNet = GLM + Elastic-Net penalization $\endgroup$
    – Firebug
    Sep 17, 2020 at 21:16

1 Answer 1


It's logistic regression with different penalization/regularization (LASSO=L1 regularization, or ridge=L2 regularization, or elastic net = LASSO & ridge = L1 and L2 regularization). It is a regression model, but the predicted probabilities can then be used for categorization (if that makes sense). I assume the name glmnet comes from Generalized Linear Model (generalized = using link functions & other distributions to generalize regression to binary and other outcomes such as Poisson etc.) and elastic-net.

By the way, the package also has some other options like averaging a penalized with a non-penalized for the non-zero coefficients, but that's still logistic regression.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.