Reputation: 175
I'm trying to perform a multivariate lasso regression on a dataset with 300 independent variables and 11 response variables using glmnet
library. I'd like to group some of the input variables and then apply multivariate grouped lasso regression so that all the grouped variables are either selected or discarded by the lasso model depending on their significance. How can I achieve this? I did look into grplasso
package but it doesn't support multivariate regression.
Upvotes: 1
Views: 1051
Reputation: 152
I assume you mean multinomial regression as you have a multiclass problem (11 classes). In addition, you want to apply group lasso. My recommendation is to use msgl package because it supports group lasso, sparse group lasso and the regular lasso as well. This can be done by supplying the alpha parameter
Alpha : the α value 0 for group lasso, 1 for lasso, between 0 and 1 gives a sparse group lasso penalty.
You can use it for binary classification or multiclass classification as in your problem. You may also tune your lambda using cross-validation using the same package. The documentation is pretty clear and there is also a nice get started page with an example of how to group your variables and perform your analysis. According to my personal experience with this package, it is incredibly fast but it is not as friendly as glmnet package.
One more thing, the package depends on another prerequisite package that needs to be installed as well which is sglOptim
Upvotes: 1