Abstract
Sequential Pattern Mining (SPM) is a fundamental task in data science, yet traditional algorithms often suffer from the "pattern explosion" problem, generating vast quantities of irrelevant results. This paper introduces TaSPM, a novel framework designed for targeted sequential pattern mining. TaSPM focuses on finding frequent sequences that contain a specific user-defined query sequence. By integrating four specialized pruning strategies into a vertical bitmap-based mining process, TaSPM achieves up to an order of magnitude speedup and significantly lower memory consumption compared to state-of-the-art general SPM algorithms.
Introduction
Sequential Pattern Mining (SPM) identifies ordered sequences of events within a database, such as a customer's progression from purchasing a phone to a case and then a screen protector. While powerful, standard SPM algorithms attempt to find every frequent sequence, which is computationally expensive and often results in a deluge of irrelevant patterns.
Existing "targeted" mining approaches are frequently too restrictive, often requiring the query item to appear at a specific position (e.g., the end of the sequence). TaSPM addresses this by providing a generic framework capable of finding frequent patterns containing a query sequence anywhere within them. This applies to both single-item data and complex transactions where multiple items occur simultaneously (itemsets).
Methodology: The TaSPM Framework
TaSPM is built upon the CM-SPAM algorithm, which utilizes a vertical bitmap representation for efficient data storage and fast support counting via bitwise operations. The core innovation of TaSPM lies in its four "targeted" pruning strategies that optimize the search process by skipping regions of the search space that cannot contain the user's query:
- Unpromising Transaction Filter Pruning (UTFP): A pre-processing step that eliminates any transaction from the database that does not contain the query sequence.
- Unpromising Prefix Item Pruning (UPIP): Prunes items in the initial stage that cannot serve as a valid starting point for a sequence fulfilling the query.
- Unpromising S-Extension/I-Extension Pruning (USIP & UIIP): During recursive search, these strategies use location-aware logic to determine if adding a new itemset (S-extension) or an item to an existing set (I-extension) can still lead to a valid target pattern.
To track progress, the algorithm maintains two flags: IMatch, indicating how many itemsets of the query have been matched, and IIMatch, indicating the number of items matched within the current itemset. This allows the algorithm to "look ahead" and stop exploring branches where the remaining items in a transaction are insufficient to complete the query.
Experimental Evaluation
The authors evaluated TaSPM against the baseline CM-SPAM using six diverse datasets, including real-world text (Bible), sign language (Sign), traffic records (Accidents10k), and synthetic multi-item datasets (Syn10k, Syn20k, Syn40k).
Key Results
- Efficiency: $TaSPM_{V2}$ (utilizing all pruning strategies) consistently outperformed the baseline, often reducing execution time by more than an order of magnitude on dense and synthetic datasets.
- Memory Footprint: TaSPM demonstrated significantly lower memory usage, largely due to the UTFP strategy filtering irrelevant transactions early in the process.
- Search Space Reduction: The number of bitmap intersections—the primary computational bottleneck—was reduced by 20 to 50 times compared to the baseline.
- Scalability: TaSPM showed linear scalability as dataset sizes increased, whereas the baseline algorithm's runtime grew exponentially.
Conclusion and Future Work
TaSPM demonstrates that incorporating query-specific knowledge into the mining process itself, rather than as a post-processing filter, leads to dramatic performance improvements. While current work focuses on frequency-based mining, future research could extend this targeted approach to High-Utility Sequential Pattern Mining (HUSPM) to identify patterns that are both relevant to a query and highly profitable, or explore the integration of negative patterns.
Summary updated