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 am getting the following error "The given structure has 5 separated graph components. Please make sure it has only one."
Structure was learnt with notears but when i run bn = BayesianNetwork(sm) i get the above error. Any advice? How can I select or display the particular subgraphs
Context
Trying to compute CPT and display markov blanket
The text was updated successfully, but these errors were encountered:
Ideally, the structure model to be fed into BayesianNetwork should be a single connected component with no isolated nodes.
You can use plot_structure to inspect the graph produced by NOTEARS, as per this tutorial, and then manually remove nodes or edges based on, e.g., input from domain experts. We also have a helper function sm.get_largest_subgraph() to extract the largest connected component in the graph, as well as sm.get_target_subgraph() to extract the subgraph for a given node.
Alternatively, to iterate over all subgraphs, you can use the function weakly_connected_components in networkx. For example:
Description
I am getting the following error "The given structure has 5 separated graph components. Please make sure it has only one."
Structure was learnt with notears but when i run
bn = BayesianNetwork(sm)
i get the above error. Any advice? How can I select or display the particular subgraphsContext
Trying to compute CPT and display markov blanket
The text was updated successfully, but these errors were encountered: