causal-learn icon indicating copy to clipboard operation
causal-learn copied to clipboard

the direct of two nodes in adjacency matrix which is result of ICALiNGAM

Open changyunke opened this issue 2 years ago • 3 comments

how to get the right graph direction between tow nodes? for example:

causal_order_ = [3,0,2,1,4,5] adjacency_matrix = [[0, 0, 0, 3, 0, 0] [3, 0, 2, 0, 0, 0] [0, 0, 0, 6, 0, 0] [0, 0, 0, 0, 0, 0] [8, 0, -1, 0, 0, 0] [4, 0, 0, 0, 0, 0]] how can I get the right directed graph?

thank you

changyunke avatar Jun 01 '23 11:06 changyunke

Hi, here is the graph corresponding to your adjacency_matrix: image

kunwuz avatar Jun 01 '23 16:06 kunwuz

i understood how you did it, but do u have a method which generates the graph rom the adjacency matrix?

asha24choudhary avatar Dec 10 '23 10:12 asha24choudhary

For LiNGAM-based methods, you may use

from causallearn.search.FCMBased.lingam.utils import make_dot make_dot(model.adjacency_matrix_, labels=labels)

kunwuz avatar Jan 14 '24 17:01 kunwuz