FenTechSolutions / CausalDiscoveryToolbox

Package for causal inference in graphs and in the pairwise settings. Tools for graph structure recovery and dependencies are included.
https://fentechsolutions.github.io/CausalDiscoveryToolbox/html/index.html
MIT License
1.08k stars 198 forks source link

Fixed the violation of nodes ordering #117

Closed TheSignPainter closed 2 years ago

TheSignPainter commented 2 years ago

Fixed the violation of nodes ordering caused by nx.adj_matrix and nx.relabel_nodes. Bug: The ordering of data(.csv format) columns is not always consistent with the ordering of nodes in nx.graph, thus causing an erroneous mapping. Sorting both lists before calling nx.adj_matrix and nx.relabel_nodes fixes the problem. Also, nx.adj_matrix is deprecated and is replaced by nx.adjacency_matrix.