graphical_models.classes.dags.dag.DAG.moral_graph
- DAG.moral_graph()[source]
Return the (undirected) moral graph of this DAG, i.e., the graph with the parents of all nodes made adjacent.
- Returns
Moral graph of this DAG.
- Return type
UndirectedGraph
Examples
>>> from graphical_models import DAG >>> d = DAG(arcs={(1, 3), (2, 3)}) >>> ug = d.moral_graph() >>> ug.edges {frozenset({1, 3}), frozenset({2, 3}), frozenset({1, 2})}