dotime.InterventionSpec
- class dotime.InterventionSpec(targets, times, intervention_type, values)[source]
Bases:
objectSpecification of an intervention on a temporal SCM.
- Attributes:
targets: List of variable indices to intervene on times: List of time indices when intervention is active intervention_type: Type of intervention (hard, soft, time-varying) values: Intervention values (constant, shift, or time-varying function)
- Parameters:
- __init__(targets, times, intervention_type, values)
Methods
__init__(targets, times, intervention_type, ...)from_dict(d)Reconstruct an
InterventionSpecfromto_dict()output.to_dict()JSON-serializable view of the spec (round-trips via
from_dict()).Attributes
- intervention_type: InterventionType
- to_dict()[source]
JSON-serializable view of the spec (round-trips via
from_dict()).The
valuesfield is encoded by kind: a scalar, a densetensorlist, or a named time-varyingprofilewith its parameters.- Return type:
- classmethod from_dict(d)[source]
Reconstruct an
InterventionSpecfromto_dict()output.- Return type:
- Parameters:
d (dict)