5.3.1. pywhy_graphs.export.graph_to_pcalg#

pywhy_graphs.export.graph_to_pcalg(causal_graph)[source]#

Convert causal graph to a pcalg type adjacency array.

Parameters:

causal_graph : instance of causal graph

The causal graph that is represented in pywhy. Either CPDAG, or PAG.

Returns:

numpy_graph : array-like of shape (n_nodes, n_nodes)

The numpy array that represents the graph. The values representing edges are mapped according to a pre-defined set of values. See Notes.

See also

pcalg_to_graph

Notes

See pcalg_to_graph() for information on how edges are represented in pcalg.