get_hierarchy_tree#
- graph_tool.inference.get_hierarchy_tree(state, empty_branches=False)[git][source]#
Obtain the nested hierarchical levels as a tree.
This transforms a
NestedBlockStateinstance into a singleGraphinstance containing the hierarchy tree.- Parameters:
- state
NestedBlockState Nested block model state.
- empty_branches
bool(optional, default:False) If
empty_branches == False, dangling branches at the upper layers will be pruned.
- state
- Returns:
- tree
Graph A directed graph, where vertices are blocks, and a directed edge points from an upper to a lower level in the hierarchy.
- label
VertexPropertyMap A vertex property map containing the block label for each node.
- order
VertexPropertyMap A vertex property map containing the relative ordering of each layer according to the total degree of the groups at the specific levels.
- tree
See also
NestedBlockStateNested stochastic block model
minimize_nested_blockmodel_dlInference of the nested block model
graph_tool.draw.draw_hierarchyDraw a nested block model hierarchy