Question about how to deal with weighted networks in SBM
Dear all, I have been using the lasted version of graph-tools, compiled from master and I'm not having much success with using weighted networks on the method "minimize_nested_blockmodel_dl" I'm passing the weights as the "recs" argument. The code executes the entire task, but when I visualize the communities doesn't seem to be correctly assigned. I would appreciate if someone could, please, show an example of use, or take a look at my code, as follow: ... gtGraph = gt.Graph(directed=True) gtGraph.add_edge_list(edges) #load the weight prop = gtGraph.new_edge_property("double") for i,e in enumerate(edges): prop[gtGraph.edge(e[0],e[1])] = w[i] state = gt.minimize_nested_blockmodel_dl(gtGraph, state_args={"recs":[prop], "rec_types":['real-normal']}) ... Tank you. Best regards. Henrique.
On 16.10.2017 07:54, Henrique Ferraz de Arruda wrote:
Dear all, I have been using the lasted version of graph-tools, compiled from master and I'm not having much success with using weighted networks on the method "minimize_nested_blockmodel_dl"
I'm passing the weights as the "recs" argument. The code executes the entire task, but when I visualize the communities doesn't seem to be correctly assigned. I would appreciate if someone could, please, show an example of use, or take a look at my code, as follow:
...
gtGraph = gt.Graph(directed=True) gtGraph.add_edge_list(edges)
#load the weight prop = gtGraph.new_edge_property("double")
for i,e in enumerate(edges): prop[gtGraph.edge(e[0],e[1])] = w[i]
state = gt.minimize_nested_blockmodel_dl(gtGraph, state_args={"recs":[prop], "rec_types":['real-normal']})
...
I don't see anything wrong with the above. If you want a complete example of use, look at the documentation: https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-... It is difficult to say anything more concrete without a complete and self-contained example, and an explanation of what you mean by communities not being "correctly assigned". Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Henrique Ferraz de Arruda -
Tiago de Paula Peixoto