huawei-noah / trustworthyAI

Trustworthy AI related projects
Apache License 2.0
958 stars 216 forks source link

how do i know the direction of edges? #115

Open wangjianqiao111 opened 1 year ago

wangjianqiao111 commented 1 year ago

i use castle.algorithms PC get the causal_matrix: [[0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0 1 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0] [0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0] [0 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0] [0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0] [0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1] [0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0] [0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0] [0 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1] [0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0] [0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0]] how do i know the Direction of edges?

VineetMalik14 commented 1 year ago

A non-zero entry $i$, $j$ corresponds to an edge from $i$ to $j$. For example in your causal matrix, $matrix[0,1]=1$, meaning an edge from $0$ to $1$. If both $matrix[i,j]$ and $matrix[j,i]$ are $1$, it corresponds to an undirected edge between $i$ and $j$.

cloudy-sfu commented 11 months ago

Helpful.

Suggest to add x-axis and y-axis labels in figures created by GraphDAG. Many other research uses the causal matrix of transposed meaning. It's better to claim it clearly.