dirconn.Provenance#
- class dirconn.Provenance(method: str, parameters: dict[str, ~typing.Any] = <factory>, model_order: int | None = None, seed: int | None = None, backend: str | None = None, input_hash: str | None = None, preprocessing: dict[str, ~typing.Any] = <factory>, versions: dict[str, str] = <factory>, assumptions: ~dirconn.data.provenance.AssumptionChecklist = <factory>, claim: str = 'predictive, not interventional', history: tuple[dict[str, ~typing.Any], ...] = (), details: dict[str, ~typing.Any] = <factory>)#
Everything needed to understand and reproduce a result.
All free-form fields are normalised to strict JSON types on construction, so a stored provenance never aliases the caller’s objects and always survives a JSON round trip.
- Parameters:
method (str) – Name of the estimator that produced the result.
parameters (dict) – Estimator parameters.
model_order (int, optional) – Model order used, when the method has one.
seed (int, optional) – Random seed, when the method or its statistics are stochastic.
backend (str, optional) – The implementation actually used, for example
"own numpy OLS MVAR".input_hash (str, optional) –
array_hash()of the input data.preprocessing (dict) – Declared preprocessing (filter, reference, standardisation, …).
versions (dict) – Package versions; collected from the current environment by default.
assumptions (AssumptionChecklist) – Assumption diagnostics; all
"not_checked"by default.claim (str) – What the result claims. Always
"predictive, not interventional"unless overridden.history (tuple of dict) – Post-processing steps applied after estimation, oldest first.
details (dict) – Method-specific facts derived during estimation, for example the order-selection curves or the number of observations. Normalised to strict JSON like
parameters.
- __init__(method: str, parameters: dict[str, ~typing.Any] = <factory>, model_order: int | None = None, seed: int | None = None, backend: str | None = None, input_hash: str | None = None, preprocessing: dict[str, ~typing.Any] = <factory>, versions: dict[str, str] = <factory>, assumptions: ~dirconn.data.provenance.AssumptionChecklist = <factory>, claim: str = 'predictive, not interventional', history: tuple[dict[str, ~typing.Any], ...] = (), details: dict[str, ~typing.Any] = <factory>) None#
Methods
__init__(method, parameters, ~typing.Any] =, ...)from_dict(data)Rebuild a provenance from
to_dict()output.from_json(text)Rebuild a provenance from
to_json()output.to_dict()Return a JSON-compatible dictionary.
to_json([indent])Serialise to a strict JSON string.
with_step(step)Return a copy with a post-processing step appended to
history.Attributes
backendclaimhistoryinput_hashmodel_orderseedmethodparameterspreprocessingversionsassumptionsdetails