causaldag.classes.dag.DAG.markov_blanket_of¶
-
DAG.markov_blanket_of(node: Hashable) → set[source]¶ Return the Markov blanket of
node, i.e., the parents of the node, its children, and the parents of its children.Parameters: node – Node whose Markov blanket to return. See also
Returns: the Markov blanket of node.Return type: set Example
>>> import causaldag as cd >>> g = cd.DAG(arcs={(0, 1), (1, 3), (2, 3), (3, 4}) >>> g.markov_blanket_of(1) {0, 2, 3}