# model selection with glmnet

I am trying to fit a multinomial logit model using glmnet. I have a few questions:

1. How is the baseline category specified?

2. Looking at the model coefficients using coef.glmnet, I'm thinking that many are given by a dot. I assume this means the coefficient was set to zero by LASSO, so the variable was dropped. However, I'm finding that variables are dropped this way even when lambda=0, so there is no regularizing term. Can someone explain what's going on here?

3. Sometimes I find that a variable is dropped in some but not all of the logits. How should this be interpreted?

Here is a working example:

library(glmnet)
data(iris)
X <- model.matrix(Species ~., data=iris)
y <- iris\$Species
fit <- glmnet (X, y, family="multinomial")
coef(fit, s=0)

• Please ask only one question per post ( you can link between them for common background) – kjetil b halvorsen Sep 4 '18 at 19:59

Q1: glmnet do not use (or need) a baseline category. The penalization takes care of the linear dependence, no matrix is inverted during the fitting! Furthermore, it would be an error to use a baseline category, because different choices would lead to fitted models giving different predictions. See discussion in Dropping one of the columns when using one-hot encoding