You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently use the following code to add forbidden edges, but it's taking so long when the adjacency matrix (in the example below named partial_order) is large for adding background knowledge, is there any way to make this more efficient in the causal-learn package?
import numpy as np
nodenames = final_df.columns
bk= BackgroundKnowledge()
position_matrix = np.argwhere(partial_order == 1)
for coordinate in position_matrix:
x, y = coordinate
node1 = nodenames[x]
node2 = nodenames[y]
bk.add_forbidden_by_node(GraphNode(node2), GraphNode(node1))
The text was updated successfully, but these errors were encountered:
Hi, this improved version of BackGroundKnowledge might be helpful, which is proposed and implemented by @verae98. Also a related issue: #90
Not sure if the solution is 100% free of issues, but that could be great to try. Let me know if you have any better ideas, or would like to contribute perhaps by incorporating that solution :)
I currently use the following code to add forbidden edges, but it's taking so long when the adjacency matrix (in the example below named
partial_order
) is large for adding background knowledge, is there any way to make this more efficient in thecausal-learn
package?The text was updated successfully, but these errors were encountered: