Static visualizations#

Static visualizations of sequences and frequent sequential patterns (matplotlib).

Every function returns the matplotlib Axes it drew on (multi-panel views return the Figure) and accepts an ax argument; none calls plt.show().

More than thirty matplotlib views of sequences and patterns.

Functions#

db_colors(db[, top, by_label])

Colors of the items of a database (most frequent first), keyed by label or item.

embed_patterns(ps[, similarity, method])

Coordinates of the patterns from a similarity (name, matrix, or a list of them to fuse).

item_colors(items[, top, order])

Stable item → color mapping.

plot_arc_diagram(sequence[, ax, min_length, ...])

Arc diagram of the repeated subsequences of one long sequence (Wattenberg, 2002).

plot_chord(db[, ax, top, min_count, ...])

Chord diagram of the transitions between the top most frequent events.

plot_communities(ps[, similarity, ax, knn, ...])

Pattern communities (Louvain) on the MDS map, with convex hulls and representative patterns.

plot_cover(db, summary[, ax, max_sequences, ...])

Cover of the sequences by the patterns of an MDL summary.

plot_dotted_chart(db[, ax, max_sequences, ...])

Dotted chart: every event a dot at (time, sequence), colored by event.

plot_double_tree(db, anchor[, ax, ...])

Word tree in both directions around a pivot event or pattern.

plot_embedding(ps[, similarity, method, ax, ...])

2-D map of the patterns from any similarity (or a fused list of similarities).

plot_episode_timeline(episodes[, top, ax, ...])

Minimal occurrences of the most frequent serial episodes on the time axis.

plot_explosion(counts[, ax, log, title])

Number of all, closed and maximal patterns against the minimum support.

plot_gap_distribution(ps[, top, ax, which, ...])

Box plots of the time span (or the gaps) of the occurrences of the top patterns.

plot_growth_sankey(ps[, ax, start_items, ...])

How support splits when frequent sequences grow (support flows of the extension network).

plot_hon(obj[, ax, max_order, min_support, ...])

Pattern-induced higher-order network (memory nodes around their first-order event).

plot_icicle(obj[, ax, max_depth, min_count, ...])

Icicle plot of the prefix tree (CoreFlow/LifeFlow style).

plot_incidence(ps[, ax, top, max_sequences, ...])

Pattern–sequence incidence matrix \(\mathbf{T}\) with seriated rows and columns.

plot_landscape(ps[, similarity, method, ax, ...])

Pattern landscape: support-weighted density of the MDS map as a terrain with labeled peaks.

plot_lattice(ps[, ax, max_length, ...])

Hasse diagram of the containment order, one row per pattern length.

plot_matrixwave(db[, steps, top, figsize, title])

MatrixWave-style sequence of transition matrices between consecutive steps.

plot_nbvfs(model[, ax, labels, label_style, ...])

Draw a fitted NBVFS map.

plot_nbvfs_cm(ps[, ax, start_items, weight, mds])

Fit and draw the confidence-based MDS map (NBVFS-CM); start_items highlights trees.

plot_nbvfs_tm(ps[, ax, start_items, mds])

Fit and draw the transaction-based MDS map (NBVFS-TM).

plot_nbvfs_wn(ps[, layout, ax, start_items, ...])

Fit and draw the weighted extension network (NBVFS-WN) of a pattern set.

plot_overview(ps[, figsize, title])

Six linked views of one mining run: sunburst of the raw sequences, NBVFS-WN, NBVFS-TM, transition graph, sequence index plot with the top pattern, and the support/confidence plane.

plot_pattern_scatter(ps[, x, y, ax, ...])

Patterns as points in the plane of two measures, linked to their parents.

plot_patterns(ps[, top, by, measures, ...])

Glyph table of the best patterns: events as colored tiles, measures as bars.

plot_prediction(ps, observed[, k, ax, title])

Prediction fan: the observed events, the matched frequent context, and the ranked continuations.

plot_prefix_tree(obj[, ax, max_depth, ...])

Node-link prefix tree with edges as wide as the number of sequences passing.

plot_rules_matrix(ps_or_rules[, ax, ...])

Grouped matrix of sequential rules: antecedents in columns, consequents in rows.

plot_sankey(db[, ax, max_steps, top, ...])

Alluvial diagram of the first steps of the sequences.

plot_sequence_frequency(db[, ax, top, ...])

The most frequent complete sequences, bar height proportional to their frequency.

plot_sequence_index(db[, ax, max_sequences, ...])

Sequence index plot: one row per sequence, one colored cell per element.

plot_sequence_logo(db[, anchor, ax, before, ...])

Sequence logo of the events around an anchor (or of the first positions).

plot_similarity_matrix(ps[, similarity, ax, ...])

Seriated heatmap of a pattern similarity with its dendrogram.

plot_state_distribution(db[, ax, max_steps, ...])

Chronogram: distribution of the events at every position, with the cross-sectional entropy.

plot_sunburst(obj[, ax, max_depth, ...])

Sequences sunburst: depth on rings, angle proportional to the number of sequences.

plot_transition_graph(db[, ax, min_count, ...])

Directly-follows graph: node size = occurrences, edge width = transitions, color = probability.

plot_transition_matrix(db[, ax, normalize, ...])

Heatmap of first-order transition counts or probabilities (normalize="row", None).

plot_upset(ps[, top, max_intersections, ...])

UpSet plot of the supporting sequences of the top patterns.

seriate(S[, method])

Order of rows/columns that places similar items next to each other (hierarchical clustering).

tree_data(obj[, max_depth, min_count, ...])

The tree behind the tree views: a prefix tree of a database or the pattern tree of a pattern set.

Constants#

BRAND

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

CATEGORICAL

Built-in mutable sequence.

OKABE_ITO

Built-in mutable sequence.