Preface
Event logs are everywhere: the clicks of a web session, the alarms and operator actions of a chemical plant, the moves of a chess game, the activities of a working day. Sequential pattern mining condenses such logs into the sequences of events that many of them share. The condensation, however, comes at a price. A mining run easily returns hundreds or thousands of frequent sequences, most of them variations of each other, and a table of them tells little about the process that produced the data. The patterns have to be seen: which sequences grow out of which, where a process branches, which patterns belong to the same sub-process, how a group of users differs from another.
The origin of the book. In 2024 László Bántay and János Abonyi proposed three network-based views of frequent sequences [1]: a weighted network that links every sequence with its one-event extensions, and two maps obtained by multidimensional scaling, one from the confidences along the extension tree and one from the co-occurrence of the sequences in the same traces. The method grew out of the alarm-management research of the group [2, 3, 4], where operators have to understand alarm floods in minutes. The scripts of the paper [5] combined the SPMF library, pandas, NetworkX and pyvis. This book and its companion package, spmviz, turn them into a general toolbox and place the network-based views among the other visualizations of frequent sequences proposed in data mining, visual analytics, process mining and the social sciences.
What the package offers. spmviz contains five sequential pattern miners written in pure Python (PrefixSpan, SPAM, CM-SPAM, SPADE and GSP, all with gap, span and time constraints), closed, maximal and generator patterns, top- mining, sequential rules and episodes, and adapters to the miners available in Python and Java. On top of the mined patterns it offers nearly forty static views, most of them with an interactive twin: the three network-based views of the paper and a fused fourth one, trees (sunburst, icicle, LifeFlow, word tree), flows (Sankey, directly-follows graph, MatrixWave, chord), matrices and maps (incidence, similarity, grouped rule matrix, measure scatter, lattice, UpSet), and the sequence views of social-science sequence analysis and process mining (index plot, chronogram, dotted chart, sequence logo). Several views are new: the continuation-entropy tree, the contrast sunburst, the growth Sankey, pattern-induced higher-order networks, pattern landscapes, and community-based segmentation of the pattern set into sub-logs. Every graph is a NetworkX object, every table a pandas data frame, and every result can be written to SPMF, GraphML, GEXF, Cytoscape or JSON files, so that the analysis can continue in Gephi, Cytoscape, R or a spreadsheet.
Who the book is for. The book is written for data scientists, process engineers, web and business analysts, and graduate students who analyse event data. It assumes elementary probability and graph theory and some Python. Every method is stated in a box and summarized in a few bullets, and every chapter ends with examples that run on bundled data: two real logs of the original paper, small textbook databases, synthetic data whose structure is known, and the public benchmark databases of the sequential pattern mining literature.
How to run the examples. The package is installed with pip install spmviz. The scripts that produce the figures are in the examples/ directory of the repository, grouped by chapter, and are listed in chapter C. The online documentation renders them as a gallery and as Jupyter notebooks. The code printed in the chapters is extracted from the same scripts, so it runs with the version of the package that the book describes.
Acknowledgments. The network-based views and the industrial alarm log come from the doctoral research of László Bántay at the University of Pannonia. We thank the authors of SPMF, NetworkX, pm4py and the other open-source libraries on which the package builds. The research summarized in this book was supported by the National Research, Development and Innovation Office of Hungary (NKFIH) through the OTKA 143482 project.
Veszprém, November 2026 The authors