Skip to content

Enable passthrough of arguments to scipy.optimize.minimize via ClarkLDF.fit #669

@genedan

Description

@genedan

Description

ClarkLDF solves for the curve parameters by using scipy.optmize.minimize:

idx_params.append(
minimize(fun=solver, x0=x0.flatten(), bounds=bounds).x.reshape(1, 1, 1, -1)
)

I have received a surprising amount of questions at work concerning optimization algorithms, such as which one I used, how many iterations it took, what the starting position was, etc., and then being requested to try out different variations on these attributes and then documenting them.

scipy.optimize.minimize offers a variety of algorithms and parameters, and also has the ability to return iteration-by-iteration results (something I have been asked to provide in the past) by controlling the arguments.

By allowing the passthrough of arguments in ClarkLDF.fit, we can allow users to answer such questions and accommodate these requests.

Is your feature request aligned with the scope of the package?

  • Yes, absolutely!
  • No, but it's still worth discussing.
  • N/A (this request is not a codebase enhancement).

Describe the solution you'd like, or your current workaround.

Something like:

ClarkLDF.fit(self, X, y=None, sample_weight=None, *args, **kwargs)

Where *args, **kwargs can be passed through to scipy.optimize.minimize

Do you have any additional supporting notes?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort > Moderate 🐕Mid-sized tasks estimated to take a few days to a few weeks.Impact > Moderate 🔶User-visible but non-breaking change. Treated like a minor version bump (e.g., 0.6.5 → 0.7.0).

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions