Fix LASSO (first two of #342)#343
Merged
Mec-iS merged 2 commits intosmartcorelib:developmentfrom Nov 28, 2025
Merged
Conversation
* change loss function in doc to match code * allow `n == p` case
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #343 +/- ##
===============================================
+ Coverage 45.59% 45.77% +0.18%
===============================================
Files 93 93
Lines 8034 7958 -76
===============================================
- Hits 3663 3643 -20
+ Misses 4371 4315 -56 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Mec-iS
reviewed
Nov 27, 2025
Collaborator
Mec-iS
left a comment
There was a problem hiding this comment.
please add a test specific for the behaviour as you have fixed it.
Contributor
Author
|
add a test case for please fix this line: let w = Lasso::fit(&x, &y, param).unwrap().coefficients.unwrap().iter().copied().collect_vec(); // FIXME: better way?The fit result is a column vector stored in a 2d array. I didn't figure out how to get a |
Collaborator
|
thank you @georeth I guess what you are looking for is: let w: Vec<f64> = Lasso::fit(&x, &y, param)
.unwrap()
.coefficients()
.iterator(0)
.copied()
.collect();Please also run |
Contributor
Author
|
fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Current behaviour
Lasso::fit(X, y) with square X fails.
New expected behaviour
allow
n==pcaseChange logs
LASSO
n == pcase