graphical_models.classes.dags.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.

Returns

the Markov blanket of node.

Return type

set

Example

>>> from graphical_models import DAG
>>> g = DAG(arcs={(0, 1), (1, 3), (2, 3), (3, 4})
>>> g.markov_blanket_of(1)
{0, 2, 3}