spmviz: mining and visualizing frequent sequences ================================================= .. image:: _static/banner.png :alt: spmviz :class: fc-banner **spmviz** mines frequent sequences from event logs and shows them. It implements the *network-based visualization of frequent sequences* of Bántay and Abonyi (PLOS ONE, 2024) — the weighted extension network and the confidence- and transaction-based maps — and places it among nearly forty other views from data mining, visual analytics, process mining and sequence analysis. Five sequential pattern miners in pure Python, adapters to SPMF and other libraries, and export of every result to pandas, NetworkX, Gephi and Cytoscape make it a complete toolbox for event data. .. grid:: 1 2 2 3 :gutter: 3 .. grid-item-card:: Mining :link: api/mining :link-type: doc PrefixSpan, SPAM, CM-SPAM, SPADE and GSP with gap, span and time constraints; closed, maximal and generator patterns; top-k; rules; episodes. .. grid-item-card:: NBVFS maps :link: api/nbvfs :link-type: doc The weighted extension network (WN), the confidence (CM) and transaction (TM) maps of the 2024 paper, a fused map and pattern communities. .. grid-item-card:: Trees :link: auto_examples/03_trees/index :link-type: doc Prefix and pattern trees, sunbursts, icicles, LifeFlow, word and double trees, continuation-entropy and contrast trees. .. grid-item-card:: Flows :link: auto_examples/04_flows/index :link-type: doc Sankey diagrams, directly-follows graphs, MatrixWave, chord diagrams, growth Sankey, pattern-induced higher-order networks. .. grid-item-card:: Matrices, maps, sets :link: auto_examples/05_maps/index :link-type: doc Seriated incidence and similarity matrices, grouped rule matrices, measure scatter plots, pattern landscapes, lattices, UpSet plots. .. grid-item-card:: Sequence views :link: auto_examples/06_sequences/index :link-type: doc Index plots, chronograms, dotted charts, sequence logos, arc diagrams, episode timelines and MDL summaries. .. grid-item-card:: Import and export :link: interoperability :link-type: doc pandas event logs, SPMF, XES, pm4py; NetworkX, GEXF (Gephi), GraphML, Cytoscape, igraph; plotly and pyvis figures. .. grid-item-card:: Data sets :link: api/datasets :link-type: doc The click-stream and alarm logs of the paper, textbook and everyday examples, generators, and the SPMF benchmark databases. .. grid-item-card:: The book :link: book :link-type: doc *Mining and Visualizing Frequent Sequences in Python*: methods, algorithms and every example of the gallery. Quick start ----------- .. code-block:: python import spmviz as sv db = sv.datasets.load_clickstream() # 343 sessions, 14 services ps = sv.mine(db, min_support=0.01, max_gap=1, max_length=10) ps.to_frame().head() # patterns, supports, confidences sv.NBVFS("wn", start_items=[2]).fit(ps).plot() # weighted extension network sv.NBVFS("tm").fit(ps).plot() # transaction-based map sv.viz.plot_sunburst(db) # how the sessions begin sv.predict_next(ps, [0, 1]) # what comes next .. toctree:: :maxdepth: 1 :hidden: installation auto_examples/index api/index book interoperability migration citing changelog