I am using glmnet for LASSO. My data set contains several continuous variables and one categorical variable (it has four levels). I wondered if I could treat three dummy variables as other continuous variables. Should I use a type of group LASSO approach for the three dummies?
Asked
Active
Viewed 3,448 times
1 Answers
1
As far as I am aware glmnet doesn't have this feature implemented yet. @Glen_b's suggestion of using type.multinomial is used to group variables across all responses in a multinomial model, but there's no way of grouping independent variables in a model. see
https://cran.r-project.org/web/packages/grplasso/grplasso.pdf
for an alternative.
nolanp2
- 11
glmnet. – Glen_b Sep 10 '14 at 00:49glmnetfor running group lasso with categorical variables? I don't see anything about categorical variables at https://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html or https://cran.r-project.org/web/packages/glmnet/glmnet.pdf – Adrian Feb 22 '17 at 16:57type.multinomialargument toglmnet– Glen_b Feb 22 '17 at 22:54