You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe alternatives you've considered, if relevant
As the first step of lsq_linear is to solve the unconstrained least square problem, one might consider using the present ridge solvers for that and then call trf_linear or bvls.
Additional context
Linear models that already have a positive option are:
yes scipy.optimize.lsq_linear seems a good fit but due to L2 reg either you assemble a (n_samples + n_features, n_features) dense matrix or you need to use LinearOperator. What do you have in mind @lorentzenchr ?
@lorentzenchr
I opened PR #20231 to add positive argument to Ridge.
This feature is often needed in my job when I have to calculate positive economical impact.
I implemented it because It seems that nobody has not implemented yet.
Based on your idea, I used lsq_linear and LinearOperator, so sparse input is accepted even if positive=True.
I needed to add new solver as "trf" when using lsq_linear.
Would you please check my implementation and whether it satisfies your requirement?
Thank you!
Activity
[-]ENH Add positive argument to Ridge regression[/-][+]Add positive argument to Ridge regression[/+]agramfort commentedon Mar 31, 2021
yes scipy.optimize.lsq_linear seems a good fit but due to L2 reg either you assemble a (n_samples + n_features, n_features) dense matrix or you need to use LinearOperator. What do you have in mind @lorentzenchr ?
lorentzenchr commentedon Apr 1, 2021
I'd start with a LinearOperator and have dense and sparse support with a single minimal implementation.
cesar-ca commentedon Apr 23, 2021
Hey! I'd like to work on this!
lorentzenchr commentedon May 7, 2021
@cesar-ca Cool. Feel free to open a PR. But note that this is not the easiest issue to solve.
lorentzenchr commentedon May 25, 2021
@cesar-ca I don't see a pull request. Do you need help or did you decide not to persue?
tnakae commentedon Jun 9, 2021
@lorentzenchr
I opened PR #20231 to add positive argument to Ridge.
This feature is often needed in my job when I have to calculate positive economical impact.
I implemented it because It seems that nobody has not implemented yet.
Based on your idea, I used
lsq_linearandLinearOperator, so sparse input is accepted even ifpositive=True.I needed to add new solver as
"trf"when usinglsq_linear.Would you please check my implementation and whether it satisfies your requirement?
Thank you!