Skip to content
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

FitBase: expose **kwargs of curve_fit #6

Open
pathfinder49 opened this issue Jul 30, 2019 · 8 comments
Open

FitBase: expose **kwargs of curve_fit #6

pathfinder49 opened this issue Jul 30, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@pathfinder49
Copy link
Member

pathfinder49 commented Jul 30, 2019

Fitting with parameter values far from unity can be improved by passing characteristic parameter scales to curve_fit using the optional the x_scale keyword argument.
This argument is documneted under scipy.optimize.least_squares. curve_fit calls this function internally. **kwargs to curve_fit are passed to scipy.optimize.least_squares.

@pathfinder49 pathfinder49 added the enhancement New feature or request label Jul 30, 2019
@pathfinder49
Copy link
Member Author

We might just want to give the option of passing **kwargs to FitBase.fit.

@dnadlinger
Copy link
Member

If set to ‘jac’, the scale is iteratively updated using the inverse norms of the columns of the Jacobian matrix (as described in [JJMore]).

That's more or less what I was referring to – would this work for us? If we can avoid having to manually set this in 99.999% of cases, this seems like a huge win.

@pathfinder49
Copy link
Member Author

That might do the trick. Would it hurt to expose **kwargs though?

@dnadlinger
Copy link
Member

dnadlinger commented Aug 18, 2019

Probably not – at least if it's a named dictionary (curve_fit_args? fit_args? algorithm_options?), where it doesn't make the FitBase API more convoluted. I'd just like to avoid making the common case more complex.

@pathfinder49
Copy link
Member Author

I've modified FitBase to use x_scale='jac'. However, **kwargs should still be exposed.

@pathfinder49 pathfinder49 changed the title FitBase: expose x_scale argument of curve_fit FitBase: expose **kwargs of curve_fit Aug 20, 2019
@dnadlinger
Copy link
Member

Will do that later.

@dnadlinger
Copy link
Member

We might need update scipy in our artiq-env for that to work, by the way.

@dnadlinger dnadlinger removed their assignment Dec 17, 2019
@dnadlinger
Copy link
Member

dnadlinger commented Dec 17, 2019

Un-assigning myself, as FitBase seems like a lost cause (or, to be more precise, requires serious amounts of work to be generally useful for my experiments, like proper support for multi-dimensional data), and I'm thus unlikely to do much work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants