Abstract
Sequential pattern mining is a fundamental task in data mining, yet traditional approaches often suffer from computational inefficiency and result overload when users have specific constraints in mind. This paper presents SPIRIT (Sequential Pattern mIning with Regular expressIon consTraints), a family of algorithms that push regular expression constraints deep into the mining process. By leveraging Deterministic Finite Automata (DFA) to prune the search space, SPIRIT achieves performance improvements of over an order of magnitude compared to traditional methods.
The Challenge of Focused Mining
Traditional sequential pattern mining, exemplified by the classic GSP algorithm, relies primarily on a minimum support threshold to identify frequent patterns. While effective for general discovery, this approach faces two significant hurdles:
- Computational Waste: Resources are expended finding all frequent patterns, regardless of their relevance to the user's specific goals.
- Information Overload: Users are frequently overwhelmed by thousands of patterns that, while statistically frequent, are irrelevant to the task at hand.
A major technical challenge in addressing this is that user-defined constraints, such as Regular Expressions (REs), are typically non-anti-monotone. In standard mining, the anti-monotone property ensures that if a sequence is frequent, all its subsequences are also frequent. However, a sequence matching a specific RE does not guarantee that its subsequences will also match. This makes it difficult to "push" constraints into early mining stages without risking the omission of valid patterns.
The SPIRIT Framework
The authors propose the SPIRIT framework to integrate RE constraints directly into the mining process. The core idea is to represent the user's RE as a Deterministic Finite Automaton (DFA) and use it to prune the search space during candidate generation.
Four distinct algorithms were developed, representing a spectrum of constraint enforcement aggressiveness:
- SPIRIT(N) (Naive): Prunes sequences containing items not present in the RE. It is the closest to traditional unfocused algorithms.
- SPIRIT(L) (Legal): Ensures every candidate sequence is a "legal" path (or part of one) within the DFA.
- SPIRIT(V) (Valid): A stronger version requiring candidates to be "valid" subsequences of strings accepted by the DFA.
- SPIRIT(R) (Regular): The most aggressive version, where every candidate counted must fully satisfy the RE.
Experimental Evaluation
The researchers evaluated SPIRIT using both synthetic and real-world datasets:
- Synthetic Data: Generated using a Zipf distribution to simulate realistic item frequencies, allowing for controlled testing of parameters like sequence length and RE selectivity.
- Real-life WWW Logs: One week of server access logs from an academic department were used to mine navigation patterns (e.g., users moving from a home page to a specific degree program page).
Key Insights and Results
The study revealed a fundamental tradeoff between RE-based pruning and frequency-based pruning. If a constraint is enforced too strictly too early (as in SPIRIT(R)), the algorithm may lack the necessary frequent sub-pattern data to perform effective support-based pruning later.
Key findings include:
- Significant Speedups: Constrained algorithms (V and R) were often 10x to 50x faster than the naive approach.
- Drastic Candidate Reduction: In real-world web log tests, SPIRIT(N) tracked nearly 6,000 candidates, while SPIRIT(V) and SPIRIT(R) reduced this to 59 and 52 candidates, respectively.
- The "Goldilocks" Solution: SPIRIT(V) emerged as the most robust choice, providing an ideal balance between pruning the search space and maintaining enough flexibility for frequency-based pruning.
Conclusion
SPIRIT demonstrates that pushing non-anti-monotone constraints like regular expressions into the mining process is not only possible but highly efficient. By treating the mining process as a traversal of a DFA, SPIRIT allows users to focus their computational resources on the patterns that matter most, significantly reducing both processing time and the volume of irrelevant results.
Summary updated