Models
CustomModel
Bases: Model
Source code in opti/model.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
__init__(names, f)
Custom model for arbitrary functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
List[str]
|
names of the modeled outputs. |
required |
f
|
Callable
|
Callable that takes a DataFrame of inputs and returns a DataFrame of outputs. |
required |
Source code in opti/model.py
67 68 69 70 71 72 73 74 75 |
|
LinearModel
Bases: Model
Source code in opti/model.py
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 |
|
__init__(names, coefficients, offset=0)
Model to compute an output as a linear/affine function of the inputs, \(y = ax + b\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
List[str]
|
name of the modeled output. |
required |
coefficients
|
Dict[str, float]
|
dictionary mapping input name to the corresponding coefficient a. |
required |
offset
|
float
|
the offset b. |
0
|
Source code in opti/model.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
Model
Source code in opti/model.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
__call__(df)
Evaluate the objective values for a given DataFrame.
Source code in opti/model.py
19 20 21 |
|
__init__(names)
Base class for models of outputs as function of inputs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
List[str]
|
names of the modeled outputs. |
required |
Source code in opti/model.py
8 9 10 11 12 13 14 15 16 17 |
|
to_config()
Return a json-serializable dictionary of the objective.
Source code in opti/model.py
23 24 25 |
|
Models
Source code in opti/model.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
__init__(models)
Container for models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
models
|
Union[List[Model], List[Dict]]
|
list of models or model configurations. |
required |
Source code in opti/model.py
85 86 87 88 89 90 91 92 93 94 95 96 97 |
|
make_model(type, **kwargs)
Make a model object from a configuration dict.
Source code in opti/model.py
127 128 129 130 131 132 |
|