# What really is 'glmnet' when used in caret in R for binary classification?

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..

• GLMNet = GLM + Elastic-Net penalization Sep 17, 2020 at 21:16

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.