I ran mcmc_equilibrate on a nested block state model in a weighted graph. As
per instructions, I copied the initially computed state in another object with increased hierarchy depth to 10. However, this fixed the depth to 10. Everything computed afterwards has depth 10 even if is clear that after 3 or 4 levels the nodes converge to one. There are many empty branches and when I try to plot it with empty_branches = False, I get an error stating it is not a tree. RuntimeError: Invalid hierarchical tree: No path from source to target. Did anybody perform any similar analyses? The hierarchy after mcmc_equilibrate: <NestedBlockState object, with base <BlockState object with 24 blocks (24 nonempty), degreecorrected, with 1 edge covariate, for graph <Graph object, undirected, with 230 vertices and 11230 edges, edges filtered by (<PropertyMap object with key type 'Edge' and value type 'bool', for Graph 0x7fc3a89f1210, at 0x7fc3a64911d0>, False), vertices filtered by (<PropertyMap object with key type 'Vertex' and value type 'bool', for Graph 0x7fc3a89f1210, at 0x7fc3a64912d0>, False) at 0x7fc3a89f1210>, at 0x7fc3a6491950>, and 10 levels of sizes [(230, 24), (24, 5), (5, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1), (1, 1)] at 0x7fc3a6491590>  Sent from: http://maindiscussionlistforthegraphtoolproject.982480.n3.nabble.com/ _______________________________________________ graphtool mailing list [hidden email] https://lists.skewed.de/mailman/listinfo/graphtool 
Administrator

On 31.10.2017 15:33, ilyco wrote:
> There are many empty branches and when I try to plot it with empty_branches > = False, I get an error stating it is not a tree. > RuntimeError: Invalid hierarchical tree: No path from source to target. Which version are you using? Please provide a minimal and selfcontained example that shows the problem. Best, Tiago  Tiago de Paula Peixoto <[hidden email]> _______________________________________________ graphtool mailing list [hidden email] https://lists.skewed.de/mailman/listinfo/graphtool signature.asc (849 bytes) Download Attachment

Tiago de Paula Peixoto <tiago@skewed.de> 
I just found out the following (using gt 2.29):
If I create a GraphView of g and store it in g,
g = gt.extract_largest_component(g)
infer an SBM,
state = gt.minimize_nested_blockmodel_dl(g)
and try to draw it,
state.draw()
then I get the "RuntimeError: Invalid hierarchical tree: No path from source to target."
But if I prune the graph,
g = gt.extract_largest_component(g, prune=True)
then everything's fine.
Hope this documentation is helpful.
Haiko
Von: graphtool <[hidden email]> im Auftrag von Tiago de Paula Peixoto <[hidden email]>
Gesendet: Dienstag, 31. Oktober 2017 17:08:52 An: [hidden email] Betreff: Re: [graphtool] Nested Block State hierarchy level after mcmc_equilibrate On 31.10.2017 15:33, ilyco wrote:
> There are many empty branches and when I try to plot it with empty_branches > = False, I get an error stating it is not a tree. > RuntimeError: Invalid hierarchical tree: No path from source to target. Which version are you using? Please provide a minimal and selfcontained example that shows the problem. Best, Tiago  Tiago de Paula Peixoto <[hidden email]> _______________________________________________ graphtool mailing list [hidden email] https://lists.skewed.de/mailman/listinfo/graphtool 
In reply to this post by Tiago Peixoto
I have a question related to this
The documentation example suggests a hierarchy set to 10 levels bs = state.get_bs() # Get hierarchical partition. bs += [np.zeros(1)] * (10  len(bs)) # Augment it to L = 10 with # singlegroup levels. state = state.copy(bs=bs, sampling=True) Is there some golden rule (which I obviously don’t know) to choose such dimension? Is 10 always a good choice? More important: why I need to modify the length before mcmc_equilibrate()? d  Sent from: http://maindiscussionlistforthegraphtoolproject.982480.n3.nabble.com/ _______________________________________________ graphtool mailing list [hidden email] https://lists.skewed.de/mailman/listinfo/graphtool 
Administrator

Am 15.01.20 um 11:22 schrieb dawe:
> I have a question related to this > The documentation example suggests a hierarchy set to 10 levels > > bs = state.get_bs() # Get hierarchical partition. > bs += [np.zeros(1)] * (10  len(bs)) # Augment it to L = 10 with > # singlegroup levels. > > state = state.copy(bs=bs, sampling=True) > > Is there some golden rule (which I obviously don’t know) to choose such > dimension? Is 10 always a good choice? More important: why I need to modify > the length before mcmc_equilibrate()? sufficiently large to accommodate your posterior distribution. The algorithm will decide automatically how many layers should in fact be used. Since the number of nodes tend to decay exponentially in the upper levels, a value of 10 is often quite enough. For very large networks this can be increased to 15 or 20, but rarely we need more than this.  Tiago de Paula Peixoto <[hidden email]> _______________________________________________ graphtool mailing list [hidden email] https://lists.skewed.de/mailman/listinfo/graphtool signature.asc (849 bytes) Download Attachment

Tiago de Paula Peixoto <tiago@skewed.de> 
Free forum by Nabble  Edit this page 