fit
Fit
Class for fitting a model to data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model
|
Model
|
Model to fit. |
required |
parameters
|
list[Parameter] | Parameters
|
List or Parameters object of parameters to fit. |
required |
data
|
dict[str | Expr, ArrayLike]
|
Dictionary of data to fit to. Keys correspond to model symbols. |
required |
loss
|
Optional[Loss]
|
Loss function to use. Defaults to L2Loss. |
SELoss()
|
Attributes:
Name | Type | Description |
---|---|---|
xdata |
Independent data, typically chosen measurement points. |
|
ydata |
Dependent data, typically measurements. |
Source code in slimfit/fit.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
execute(minimizer=None, **execute_options)
Execute the fit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
minimizer
|
Optional[Type[Minimizer]]
|
Optional minimizer to use. Defaults to ScipyMinimizer. |
None
|
**execute_options
|
|
{}
|
Returns:
Type | Description |
---|---|
FitResult
|
Result of the fit as FitResult object. |
Source code in slimfit/fit.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
get_minimizer()
Automatically determine which minimizer to use
Source code in slimfit/fit.py
84 85 86 |
|