biogeme.function_output module¶
Object containing the output of numerical expression calculation
- class biogeme.function_output.DisaggregateFunctionOutput(functions, gradients=None, hessians=None, bhhhs=None)[source]¶
Bases:
object
Output of a function calculation
- Parameters:
functions (ndarray)
gradients (ndarray | None)
hessians (ndarray | None)
bhhhs (ndarray | None)
-
bhhhs:
ndarray
|None
= None¶
-
functions:
ndarray
¶
-
gradients:
ndarray
|None
= None¶
-
hessians:
ndarray
|None
= None¶
- unique_entry()[source]¶
When there is only one entry, we generate the BiogemeFunctionOutput object
- Return type:
FunctionOutput
|None
- class biogeme.function_output.FunctionOutput(function, gradient=None, hessian=None, bhhh=None)[source]¶
Bases:
object
Output of a function calculation
- Parameters:
function (float)
gradient (ndarray | None)
hessian (ndarray | None)
bhhh (ndarray | None)
-
bhhh:
ndarray
|None
= None¶
-
function:
float
¶
-
gradient:
ndarray
|None
= None¶
-
hessian:
ndarray
|None
= None¶
- class biogeme.function_output.NamedFunctionOutput(function_output, mapping, function=None, gradient=None, hessian=None, bhhh=None)[source]¶
Bases:
NamedOutputMixin
,NamedFunctionResult
Output of a function calculation, with names of variables
- Parameters:
function_output (FunctionOutput)
mapping (dict[str, int])
function (float)
gradient (dict[str, float] | None)
hessian (dict[str, dict[str, float]] | None)
bhhh (dict[str, dict[str, float]] | None)
-
bhhh:
dict
[str
,dict
[str
,float
]] |None
= None¶
-
function:
float
= None¶
-
function_output:
FunctionOutput
¶
-
gradient:
dict
[str
,float
] |None
= None¶
-
hessian:
dict
[str
,dict
[str
,float
]] |None
= None¶
-
mapping:
dict
[str
,int
]¶
- class biogeme.function_output.NamedFunctionResult(*args, **kwargs)[source]¶
Bases:
Protocol
Protocol defining the interface for named function outputs.
-
bhhh:
dict
[str
,dict
[str
,float
]] |None
¶
-
function:
float
¶
-
gradient:
dict
[str
,float
] |None
¶
-
hessian:
dict
[str
,dict
[str
,float
]] |None
¶
-
bhhh:
- class biogeme.function_output.NamedOutputMixin[source]¶
Bases:
object
Mixin providing common methods for named outputs.
- biogeme.function_output.convert_to_dict(the_sequence, the_map)[source]¶
Convert an indexed sequence into a dict mapping a name to the elements.
- Parameters:
the_sequence (
Sequence
[TypeVar
(GenericType
)]) – sequence of element to convertthe_map (
dict
[str
,int
]) – dict mapping the names with their index in the sequence.
- Return type:
dict
[str
,TypeVar
(GenericType
)]- Returns:
the sequence converted into dict