CausalDisco / gadjid

Adjustment Identification Distance: A gadjid for Causal Structure Learning
https://doi.org/10.48550/arXiv.2402.08616
Mozilla Public License 2.0
9 stars 0 forks source link

Adjacency matrix interpretation #5

Closed Whatisthisname closed 6 months ago

Whatisthisname commented 6 months ago

Currently there is an implicit assumption that an adjacency matrix

M = 
[[0, 1], 
 [0, 0]]

encodes the graph 0 -> 1.

This is the row->col interpretation:

M[X, Y] = 1 $\iff$ X -> Y.

The col->row interpretation is the opposite:

M[X, Y] = 1 $\iff$ X <- Y.

Undirected edges are unaffected by this, as

M[X, Y] = 2 $\vee$ M[Y, X] = 2 $\iff$ X -- Y.

This PR forces the users of the gadjid_python library to supply either the string "row->col" or "col->row" when passing an adjacency matrix in scipy.sparse or np.ndarray format.