# Lasso/lars

Is there a package with a LASSO/LARS algorithm? (I earlier used Lasso.jl, but it downgrades a bunch packages, so I am looking for something else.)

Maybe try glmnet.jl

2 Likes

Try https://github.com/JuliaStats/GLMNet.jl. Looks to be more recently updated.

This is a generalization of LARS/LASSO that makes a trade-off between L2 and L1 penalties. Set the alpha parameter to 1 to have a fully LASSO solution (see https://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html for some more details on the parameters).

1 Like

Notice that there is an open PR to fix Lasso.jl so it will probably work again soon.

1 Like

You can try my fork of Lasso.jl, which should work with v0.6.x until the PR is pulled.

2 Likes

If youâ€™re into just solving the problem:

$$\arg \min_{x} \frac{1}{2} {\left| A x - b \right|}{2}^{2} + \lambda {\left| x \right|}{1}$$

Then it would take only few lines to get it done in Julia (It will be a modern and fast solution).

P. S.
Is there a way to enable the MathJaX Plug In for this site?

I created a project on GitHub called - L1 Regularized Least Squares (Nothing fancy, some known modern method to deal with this problem, As expected, Iteration Wise the Coordinate Descent method was the fastest).
The implementation is in MATLAB but it will be easy to adapt it to Julia.

Once Julia 1.x.xxx is out I intent to put few of thosw into the MATLAB vs. Julia test.

1 Like

intersting â€¦ why does your objective function starts at zero and goes down to around -100 ?

shouldnâ€™t it go down to zero?

My mistake, I didnâ€™t put the [dB] there.

Update
Fixed the Y Axis Title.

Hi,
and thanks. Works very well. May I ask if you plan to eventually update to 0.7 syntax?

By the way, glmnet.jl also worked well, but the msys2/gfortran was a 3GB installation (Win64).

Yes. Canâ€™t wait for that one. But GLM.jl would need to be updated first.

The following PR passes all tests with julia 0.7 and 1.0 on my linux box:

Note that tests on julia 1.0 require GLMNet.jlâ€™s upgraded syntax as well, which is available now by running