-
Notifications
You must be signed in to change notification settings - Fork 89
add fit_intercept to LASSO #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #344 +/- ##
===============================================
+ Coverage 45.59% 45.87% +0.28%
===============================================
Files 93 93
Lines 8034 7973 -61
===============================================
- Hits 3663 3658 -5
+ Misses 4371 4315 -56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I've checked it converges to the desired value by comparing with sklearn's LassoLars. (the existing test dataset is strong enough that coordinate descent (sklearn's Lasso) converges slow) I am not very confident about whether the optimizer code assumes |
|
if you are not sure, add a couple of tests. You can just translate the ones in sklearn. |
|
There are 3 LASSO algorithms involved:
sklearn's algorithms are not suitable for my use case, and that's why I want to make changes to smartcore. |
|
The L1LS paper has no assumption, and it treat LASSO as its special case, so I think it's correct. |
|
the docstring at the top of the module Line 4 in 2bf5f7a
|
|
@Mec-iS Line 20 in 2bf5f7a
The doc also referenced a matlab implementation of L1LS (by the paper writer): Line 21 in 2bf5f7a
The matlab implementation doesn't normalize y at all: https://github.com/cvxgrp/l1_ls/blob/master/l1_ls.m |
|
are these changes breaking the API? the existing API will still be accessible or code that exists should be changed to keep using it? |
|
It doesn't breaks the API, and it doesn't introduce a numerical diff. |
|
Oh. If the user constructs a LassoParameters directly without using the builder ( This also applies to LassoSearchParameters, and LassoSearchParameters doesn't have a builder interface. |
|
Should we set intercept to pub struct Lasso<TX: FloatNumber + RealNumber, TY: Number, X: Array2<TX>, Y: Array1<TY>> {
coefficients: Option<X>,
intercept: Option<TX>,
_phantom_ty: PhantomData<TY>,
_phantom_y: PhantomData<Y>,
}I think coefficients and intercept are Option because SupervisedEstimator trait needs a |
|
0.0 is a value Breaking changes need to be added to the CHANGELOG.md file |
|
Thanks for your contribution |
Fixes #342
Checklist
Current behaviour
LASSO always fits intercept
New expected behaviour
add
fit_interceptoptionChange logs