2.2.2. pywhy_graphs.functional.apply_linear_soft_intervention#
- pywhy_graphs.functional.apply_linear_soft_intervention(G, targets: Set[Union[int, float, str, Any]], type: str = 'additive', random_state=None)[source]#
Applies a soft intervention to a linear Gaussian graph.
- Parameters:
G : Graph
Linear functional causal graph.
targets : Set[Node]
The set of nodes to intervene on simultanenously.
type : str, optional
Type of intervention, by default “additive”.
random_state : RandomState, optional
Random seed, by default None.
- Returns:
G : Graph
The functional linear causal graph with the intervention applied on the target nodes. The perturbation occurs on the
gaussian_noise_function
of the target nodes. That is, the soft intervention, perturbs the exogenous noise of the target nodes.