# Solving a constraint lasso

**URL:** <https://discourse.julialang.org/t/solving-a-constraint-lasso/59727>\
**Category:** Optimization (Mathematical)\
**Created:** [April 21, 2021, 11:08am UTC](https://discourse.julialang.org/t/solving-a-constraint-lasso/59727 "2021-04-21T11:08:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 21, 2021, 11:08am UTC](https://discourse.julialang.org/t/solving-a-constraint-lasso/59727/1 "2021-04-21T11:08:41Z")

</div>

Hi,

Recently i had the problem of solving a constraint lasso, much like the one described in [this paper](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6320228/). The paper refers to a julia package, [ConstrainedLasso.jl](https://github.com/Hua-Zhou/ConstrainedLasso.jl), that is unfornutely not updated since julia 0.6. With [some help from the forum](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/32) I gave [a shot](https://github.com/lrnv/ConstrainedLasso.jl) at updating it but without sucess so far.

Then I had a thought: Is there in the current Julia packages some infrastructure that could solve this kind of lasso problem ?

I found [GLMNet.jl](https://github.com/JuliaStats/GLMNet.jl), but which does not allow linear constraints, same thing for [Lasso.jl](https://github.com/JuliaStats/Lasso.jl) and [LARS.jl](https://github.com/simonster/LARS.jl), sadly.

---

<div class="post-metadata">

**Author:** ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Post date:** [April 21, 2021, 1:52pm UTC](https://discourse.julialang.org/t/solving-a-constraint-lasso/59727/2 "2021-04-21T13:52:13Z")

</div>

You could probably extend this example:

[https://jump.dev/Convex.jl/stable/examples/general\_examples/lasso\_regression/](https://jump.dev/Convex.jl/stable/examples/general_examples/lasso_regression/)

Might not be the quickest, but works.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 21, 2021, 3:33pm UTC](https://discourse.julialang.org/t/solving-a-constraint-lasso/59727/3 "2021-04-21T15:33:25Z")

</div>

Thanks a lot. After a quick learning of Convex.Jl (Awesome stuff Btw), i managed to add my constrained and run a constraint lasso as I wanted.

Indeed, this is quite slow to obtain the full path as I must solve it again for each regularisation parameter, and i suspect that the solver is not optimized for this kind of stuff.
