models
Model
Bases: CompositeExpr
Source code in slimfit/models.py
15 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 |
|
components
property
all NumExprBase components in the model
keys should be such that their commectivity can be reconstructed ?
ie {Mul[0]MatMul[1]:
dependent_symbols
property
Variables corresponding to dependent (measured) data, given as keys in the model dict
define_parameters(parameters='*')
Defines and initializes parameters for the model.
This method accepts parameters in various forms (dictionary, iterable, or string) and returns an instance of the Parameters class, initialized with the provided parameters and the existing symbols of the model. Default value is '*', which returns all the model's symbols as parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parameters
|
dict[str, ArrayLike] | Iterable[str] | str
|
|
'*'
|
Returns:
Name | Type | Description |
---|---|---|
Parameters |
Parameters
|
An instance of the Parameters class, initialized with the provided |
Parameters
|
parameters and the existing symbols of the model. |
Usage
Assuming we have a model instance 'm' and we want to define the symbols 'a' and 'b' are parameters:
defined_parameters = m.define_parameters("a b")
Use a dictionary to define parameters and provide initial guesses:
guess = {'a': 3., 'b': 10}
defined_parameters = m.define_parameters(guess)
Source code in slimfit/models.py
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 |
|