-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
ENH: optimize: add a new method least_squares_lm
for curve_fit
.
#18198
Conversation
Thanks @AtsushiSakai! Since you had a look at this closely, is there a reason we don't change |
Thank you for your comment @tupui. Yes, I though we should replace |
It might be worth looking into the feasibility of this. It may prove quite difficult to do this and get all the bugs ironed out. Even if it's possible one trouble is that the |
Maybe instead of trying to fit all the API of one into the API of the other, we could find a minimal set of parameters? i.e. that might mean some deprecation being introduced for the |
My initial thoughts are that |
Oh it is for sure. I am just trying, if we can, to avoid a double deprecation loop 😅 Like adding |
I might be misunderstanding but from what i understand, all the advanced feature sof
So I am not sure if this PR would only complicate the API. |
Reference issue
Fix #14337
What does this implement/fix?
The current
curve_fit
has these methods:lm
, which is usingleastsq
trf
, which is usingleast_squares
withmethod='trf'
.dogbox
, which is usingleast_squares
withmethod='dogbox'
.So, the current
curve_fit
is missing a method that is usingleast_squares
withmethod='lm'
.Both
leastsq
andleast_squares
withmethod='lm'
are based on MINPACK’s lmdif and lmder functions,but as reported in #14337,
least_squares
withmethod='lm'
has some good optional arguments ofleast_squares
.(e.g.
jac_sparsity
for large systems)So, this PR adds a new method
least_squares_lm
forcurve_fit
, which is usingleast_squares
withmethod='lm'
for curve fitting and enhanced unit tests for it.Additional information