JuliaStats / Lasso.jl

Lasso/Elastic Net linear and generalized linear models
Other
143 stars 31 forks source link

Allow passing a function to generate λ #45

Closed timholy closed 4 years ago

timholy commented 4 years ago

In some circumstances it's nice to test lasso all the way down to λ=0 (if, for example, one has a least-squares prediction), but the approach taken here doesn't make that straightforward. I felt that the most flexible approach would be to allow users to provide a function that generates the list of λ from λmax. The advantage of using a function is that calculating λmax is nontrivial, so to avoid repeating work it's best to calculate λ after λmax is known.

One of the tests here is marked @test_skip because the solution with λmax turns out not to always be null. That seems to be a violation of the documentation for fit, but I decided fixing that was beyond the scope of this PR.

coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 187


Totals Coverage Status
Change from base Build 184: 2.7%
Covered Lines: 587
Relevant Lines: 657

💛 - Coveralls
coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 187


Totals Coverage Status
Change from base Build 184: 2.7%
Covered Lines: 587
Relevant Lines: 657

💛 - Coveralls