spmviz.networks.extension_network#

spmviz.networks.extension_network(ps, weight='confidence', start_items=None, min_confidence=0.0, root=False)[source]#

Weighted extension network of frequent sequences (NBVFS-WN).

Nodes are the patterns, an edge joins every pattern to its one-item extensions; the edge weight is the extension confidence \(c(\varphi_j)=\sigma(\varphi_j)/\sigma(\varphi_i)\) (weight="confidence", the definition of the paper) or the cumulative confidence of the child (weight="cumulative", as in the reference implementation).

Parameters:
psPatternSet
weight{“confidence”, “cumulative”}
start_itemsitem or list, optional

Keep the trees of these first items only (the filter of the paper).

min_confidencefloat

Drop edges (and the subtrees below them) with a lower confidence.

rootbool

Add a virtual root "∅" linked to the single items.

Returns:
networkx.DiGraph

Node attributes: label, support, rel_support, length, confidence, cum_confidence, start, added, index; edge attributes: confidence, cum_confidence, weight, added.