ENH add sparse and sample_weight support to MultiTaskElasticNet#33440
Open
lorentzenchr wants to merge 3 commits intoscikit-learn:mainfrom
Open
ENH add sparse and sample_weight support to MultiTaskElasticNet#33440lorentzenchr wants to merge 3 commits intoscikit-learn:mainfrom
lorentzenchr wants to merge 3 commits intoscikit-learn:mainfrom
Conversation
51 tasks
eb92b15 to
47b944e
Compare
7 tasks
* MultiTaskElasticNet * MultiTaskLasso * MultiTaskElasticNetCV * MultiTaskLassoCV
47b944e to
2a1900f
Compare
Member
Author
|
@OmarManzoor Are you interested in this PR? |
OmarManzoor
reviewed
Mar 30, 2026
Contributor
OmarManzoor
left a comment
There was a problem hiding this comment.
Thank you for the PR @lorentzenchr. I had an overall look and left some comments. Overall I think it looks nice. Some tests are failing though
Comment on lines
+769
to
+772
| reg = estimator(alphas=5) | ||
| reg.fit(csr_container(X), y) | ||
| reg1 = estimator(alphas=5) | ||
| reg1.fit(csr_container(X, dtype=np.float32), y) |
Contributor
There was a problem hiding this comment.
What does reg stand for here?
Comment on lines
+898
to
+899
| for i_ind in range(startptr, endptr): | ||
| tmp += R[X_indices[i_ind]] * X_data[i_ind] |
Contributor
There was a problem hiding this comment.
To keep it consistent with the rest of the changes above
Suggested change
| for i_ind in range(startptr, endptr): | |
| tmp += R[X_indices[i_ind]] * X_data[i_ind] | |
| for i_ind in range(startptr, endptr): | |
| i = X_indices[i_ind] | |
| tmp += R[i] * X_data[i_ind] |
Comment on lines
+1549
to
+1552
| for i_ind in range(startptr, endptr): | ||
| i = X_indices[i_ind] | ||
| norm2_cols_X[j] += (X_data[i_ind] - X_mean[j]) ** 2 | ||
| norm2_cols_X[j] += (n_samples - endptr + startptr) * X_mean[j] ** 2 |
Contributor
There was a problem hiding this comment.
It doesn't seem like i is being used in this block
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.
Reference Issues/PRs
Closes #3702, finally.
Contributes to #33457
What does this implement/fix? Explain your changes.
This add support to fit
sample_weightXfor
MultiTaskElasticNetMultiTaskLassoMultiTaskElasticNetCVMultiTaskLassoCVAI usage disclosure
None
Any other comments?
#15436 (comment):
Only 6 years later and not in the same release 😄 (but note that the comment did not apply to multitask estimators of this PR).