geklappt: < /p>
Code: Select all
state = gt.minimize_nested_blockmodel_dl(g, state_args={"eweight": edge_weight})
< /code>
Hieres Beispielcode: < /p>
# Load built-in power grid network
g = gt.collection.data["power"]
print(f"Loaded 'power' network with {g.num_vertices()} nodes and {g.num_edges()} edges.")
# Assign simulated positive weights to all edges
edge_weight = g.new_edge_property("float")
for e in g.edges():
edge_weight[e] = np.random.uniform(0.1, 1.0)
# Attach weight property
g.edge_properties["weight"] = edge_weight
# Run nested SBM with weights
state = gt.minimize_nested_blockmodel_dl(g, state_args={"eweight": edge_weight})
print("Finished SBM inference.")
[*]Created an undirected graph
[*]Assigned node types
[*]Assigned edge weights, all values in the range [0.1, 1.0], strictly positive
Verified all edges and weights exist
No nodes are Isoliert < /li>
Die Eigenschaft des Randgewichts wurde korrekt hinzugefügt. Homebrew)
macOS: ventura 13.x (Apple M1)
Gibt es bekannte Fehler, die mit dem kandlollengewichteten SBM im Graph-Tool verbunden sind, das ich möglicherweise treffe?>