Mining and Visualizing Frequent Sequences in PythonThe spmviz toolbox

Every method of the toolbox has at least one runnable example script. The scripts generate or load their own data, explain the method in their comments, and end with a study of the main parameters. The same scripts produce the gallery of the online documentation, the Jupyter notebooks, and every computed figure and code listing of this book. The tables below list them by folder of examples/, with the first figure of the book that each script produced.

C.1 First steps: data, mining, constraints, files

Folder examples/01_basics/. The methods are described in chapter 2.

Script

Topic

Figure

plot_01_first_steps.py

First steps: four sequences of the PrefixSpan paper

2.2

   

plot_02_daily_routines.py

An everyday example: daily routines

2.4

   

plot_03_algorithms.py

Five algorithms, one answer

2.7

   

plot_04_constraints.py

Gaps, spans and time windows

2.8

   

plot_05_import_export.py

Import and export: pandas, SPMF, networkx, Gephi, Cytoscape

—

   

C.2 Network-based visualization of frequent sequences

Folder examples/02_nbvfs/. The methods are described in chapter 4.

Script

Topic

Figure

plot_01_weighted_network.py

NBVFS-WN: the weighted extension network

4.1

   

plot_02_confidence_mds.py

NBVFS-CM: confidence-based MDS map

4.4

   

plot_03_transaction_mds.py

NBVFS-TM: transaction-based MDS map

4.6

   

plot_04_alarm_log.py

The industrial alarm log of the paper

4.9

   

plot_05_fused_similarity.py

Beyond the paper: fused similarities and pattern communities

4.11

   

C.3 Trees: prefix trees, sunbursts, icicles, word trees

Folder examples/03_trees/. The methods are described in chapter 5.

Script

Topic

Figure

plot_01_chess_sunburst.py

A spectacular sunburst: chess openings

5.2

   

plot_02_entropy_tree.py

Where does the process branch? The continuation-entropy tree

5.5

   

plot_03_word_tree.py

Word trees around a pivot

5.6

   

plot_04_contrast_tree.py

Comparing two groups: contrast sunburst

5.9

   

plot_05_lifeflow_icicle.py

Time-aware icicles (LifeFlow)

5.11

   

C.4 Flows: Sankey diagrams, transition graphs, higher-order networks

Folder examples/04_flows/. The methods are described in chapter 6.

Script

Topic

Figure

plot_01_sankey.py

Sankey diagram of web-shop journeys

6.1

   

plot_02_transition_graph.py

Transition graphs, matrices and MatrixWave

6.4

   

plot_03_chord.py

Chord diagram of everyday transitions

6.8

   

plot_04_growth_sankey.py

How support splits when sequences grow

6.10

   

plot_05_higher_order_network.py

Pattern-induced higher-order networks: when history matters

6.12

   

C.5 Maps and matrices of pattern sets

Folder examples/05_maps/. The methods are described in chapter 7.

Script

Topic

Figure

plot_01_incidence_similarity.py

Matrices of a pattern set

7.1

   

plot_02_rules_matrix.py

Sequential rules as a grouped matrix

7.4

   

plot_03_measure_scatter.py

Patterns in the plane of two measures

7.6

   

plot_04_landscape.py

Pattern landscapes

7.8

   

plot_05_lattice_upset.py

Lattices and UpSet plots

7.10

   

C.6 Sequences: index plots, logos, arcs, episodes, summaries

Folder examples/06_sequences/. The methods are described in chapter 8.

Script

Topic

Figure

plot_01_index_plot.py

Sequence index plots with pattern occurrences

8.1

   

plot_02_chronogram_frequency.py

Chronograms and sequence frequency plots

8.3

   

plot_03_dotted_chart.py

Dotted chart of alarm floods

8.5

   

plot_04_sequence_logo.py

Sequence logos

8.7

   

plot_05_arc_diagram.py

Arc diagram of a melody

8.9

   

plot_06_episodes.py

Episodes in one long alarm stream

8.11

   

plot_07_mdl_summary.py

A summary in a few patterns: MDL

8.12

   

C.7 Applications and benchmarks

Folder examples/07_applications/. The methods are described in chapter 10.

Script

Topic

Figure

plot_01_benchmarks.py

Benchmark databases of sequential pattern mining

10.1

   

plot_02_clickstream_story.py

Case study: the UWV unemployment-benefit application

10.2

   

plot_03_alarm_early_warning.py

Case study: early warning in alarm management

10.6

   

plot_04_interactive.py

Interactive figures

—