BFSPMiner: an effective and efficient batch-free algorithm for mining sequential patterns over data streams

Marwan Hassani, Daniel Töws, Alfredo Cuzzocrea, Thomas SeidlInt. J. Data Sci. Anal 2019

Introduction

Sequential Pattern Mining (SPM) is a critical task in data science, focused on identifying ordered sets of items that frequently occur together within a dataset. In the context of high-velocity data streams, such as clickstreams or sensor data, traditional algorithms typically employ a batch-based approach. These methods partition the stream into discrete chunks, mine each independently, and aggregate the results.

However, this "chunking" strategy introduces significant limitations:

  1. Boundary Loss: Patterns that span across the end of one batch and the beginning of another are often lost.
  2. Global Frequency Issues: Patterns that are frequent across the entire stream may be pruned if they do not meet the support threshold within any single local batch.

To address these challenges, the authors propose BFSPMiner (Batch-Free Sequential Pattern Miner), an algorithm designed to process data item-by-item, eliminating the boundary errors inherent in batch-based systems.

Methodology: The BFSPMiner Algorithm

BFSPMiner moves away from the traditional chunking model in favor of continuous processing. The algorithm updates its internal model immediately upon the arrival of each new data item.

The Inverted Tree Structure

A core innovation of BFSPMiner is the use of an inverted tree structure. While traditional SPM algorithms often utilize a prefix tree (where nodes represent prefixes), BFSPMiner employs a structure where nodes represent patterns and paths to the root represent their postfixes. This architectural choice allows the algorithm to update only a single path in the tree for each incoming item, significantly reducing computational overhead and enabling real-time performance.

The inverted tree structure used by BFSPMiner to track item occurrences and patterns across the data stream.

To maintain efficiency, the algorithm incorporates a maxPatternLength parameter to bound the tree depth and an adaptive pruning strategy. This strategy periodically removes patterns that fall below specific support thresholds ($\alpha$ and $\epsilon$), ensuring a stable memory footprint even during prolonged stream processing.

System Architecture and Prediction

The BFSPMiner framework is not limited to discovery; it includes a predictive module that leverages mined patterns as rules to forecast future items in the stream.

The BFSPMiner system architecture, illustrating the flow from data preprocessing to sequential pattern mining and final item prediction.

Experimental Evaluation

The researchers evaluated BFSPMiner against nine diverse real-world datasets, including clickstreams (MSNBC, FIFA), text sequences (Bible, Leviathan), and sensor data (REDD). A primary case study involved the EyeTracking dataset, which captures gaze locations and keystrokes from translators.

Key Results

  • Pattern Completeness: BFSPMiner demonstrated superior recall compared to batch-based competitors like SS-BE and SS-LC. By avoiding boundary errors, it consistently identified a higher percentage of the "ground truth" patterns defined by the gold-standard PrefixSpan algorithm.
  • Predictive Performance: In the EyeTracking case study, BFSPMiner achieved a recall of 0.54, more than doubling the 0.24 recall of batch-based methods. This highlights the practical importance of capturing patterns that cross batch boundaries.
  • Computational Efficiency: While performance varies based on dataset density, BFSPMiner proved significantly faster on dense, high-volume streams due to its efficient single-path tree updates.

Discussion and Insights

The study reveals that the cost of batching is substantial, with traditional methods potentially missing 50-70% of frequent patterns. The transition to an inverted postfix tree is a pivotal optimization for high-velocity streams. Furthermore, the authors observed diminishing returns on context length for prediction; most predictive power is derived from the most recent 2 to 5 items.

Limitations and Future Directions

Current limitations include the manual configuration of the maxPatternLength and the interval-based nature of the pruning process. Future work will focus on developing "anytime" pruning models and adaptive thresholds that automatically adjust parameters based on available memory and real-time data characteristics.

Reference: Hassani, M., Töws, D., Cuzzocrea, A., & Seidl, T. (2019). BFSPMiner: an effective and efficient batch-free algorithm for mining sequential patterns over data streams. International Journal of Data Science and Analytics, 8:223–239.

Summary updated

BibTeX
@article{hassani2019bfspminer,
  author = {Marwan Hassani and Daniel Töws and Alfredo Cuzzocrea and Thomas Seidl},
  title = {{BFSPMiner: an effective and efficient batch-free algorithm for mining sequential patterns over data streams}},
  journal = {Int. J. Data Sci. Anal.},
  year = {2019},
  doi = {10.1007/s41060-017-0084-8},
}
Figure