Member-only story
Sparse Group Lasso in Python
How to use one of the best variable selection techniques in regression
So im here to talk about the wonderful asglpackage (the name comes from Adaptive Sparse Group Lasso) that adds a lot of features that were already available in R packages but not in python, like solving sparse group lasso models, and goes beyond that, adding extra features that improve the results that sparse group lasso can provide.
I would like to start talking about the sparse group lasso: what is it and how to use it. Specifically, here we will see:
- What is sparse group lasso
- How to use sparse group lasso in python
- How to perform k-fold cross validation
- How to use grid search in order to find the optimal solution.
What is sparse group lasso
To understand what is sparse group lasso we need to talk (briefly) about two techniques: lasso and group lasso. Given a risk function, for example the linear regression risk,
Lasso: is defined by adding a penalization on the absolute value of the β coefficients,
This definition provides sparse solutions, because it will send to zero some of the β coefficients (the least related with the…

