Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do i know the direction of edges? #115

Open
wangjianqiao111 opened this issue Jul 14, 2023 · 2 comments
Open

how do i know the direction of edges? #115

wangjianqiao111 opened this issue Jul 14, 2023 · 2 comments

Comments

@wangjianqiao111
Copy link

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
Copy link
Contributor

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants