iws.DataFit describes a parameter fit: which experiments to compare against, which parameters are free, and how to search. The schema is submitted as one element of a pipeline. For the theory (cost functions, identifiability, multi-start), see the Data Fitting Guide.
A minimal fit
Multiple objectives
Pass multiple objectives to fit against several experiments simultaneously (e.g. discharge at different C-rates or temperatures):Optimizers
iws.optimizers exposes the optimisers available to DataFit. Pick the one that fits your problem:
| Schema | Best for |
|---|---|
iws.optimizers.ScipyMinimize(method="L-BFGS-B") | Smooth problems, fast local optimisation |
iws.optimizers.ScipyLeastSquares() | Residual-based least-squares; good with priors |
iws.optimizers.DifferentialEvolution() | Global, no gradients required |
iws.optimizers.CMAES() | Global, many local minima, well-tested defaults |
iws.optimizers.PSO() | Global, parallelisable population search |
Multi-start
For problems with multiple local minima, run several optimisations from different starting points:Retrieving results
result.element_results["fit"] is a dict keyed by the data-fit’s outputs (best parameter values, final cost, and any logged trajectories). See packages/ionworks-api/examples/pipeline/datafit.py for an end-to-end example.
Data Fitting (theory)
Cost-function math, identifiability, multi-start strategy.
Objective Functions
Pick the right cost for your data shape.
Regularization
Stabilise fits with Gaussian priors.
Sensitivity Analysis
Quantify which parameters the fit actually constrains.