moralize#

causalbase.graph.moralize(dag)[source]#

Moralize a DAG into an undirected moral graph.

The moral graph is the skeleton plus an edge between every two parents of a common child.

Parameters:
dagDAG

The directed acyclic graph to moralize.

Returns:
np.ndarray

A symmetric, hollow boolean adjacency matrix of shape (dag.num_nodes, dag.num_nodes) representing the moral graph.