Closed ukamath closed 1 year ago
Got it working using DiGraph
import networkx as nx import matplotlib.pyplot as plt
dag = nx.DiGraph(model.adjacencymatrix)
node_labels = {i: f"X{i+1}" for i in range(len(dag.nodes))} dag = nx.relabel_nodes(dag, node_labels)
nx.draw(dag, with_labels=True) plt.show()
With FCM-based methods, for instance DirectiINGAM, how do we get DAG so that we can compare and contrast the structure with other methods such as PC,FCI, GES etc? Are there any utilities?
from causallearn.search.FCMBased import lingam model = lingam.DirectLiNGAM() model.fit(data)
print(model.causalorder) print(model.adjacencymatrix)
Thanks