spmviz.networks.prefix_tree#
- spmviz.networks.prefix_tree(db, max_depth=None, min_count=1, anchor=None, direction='forward', with_end=True)[source]#
Trie of the sequences (the aggregation behind sunbursts, icicles, LifeFlow and word trees).
- Parameters:
- db
SequenceDatabase - max_depth
int,optional - min_count
int Prune nodes passed by fewer sequences.
- anchor
pattern,optional Start every sequence at the end (
direction="forward") or the start ("backward") of the first occurrence of this pattern; sequences without it are skipped. This gives the two halves of a word tree.- direction{“forward”, “backward”}
- with_endbool
Count the sequences that end at each node (
n_end).
- db
- Returns:
networkx.DiGraphRooted at
"∅"; node attributesitem(token),depth,count,n_end,path(text),mean_time(elapsed time from the anchor or the start, element index units without timestamps) andentropyof the continuation at the node (bits, end included).