AI Glossary / Data science and analytics / Intermediate

Sequential pattern mining

Definition

Sequential pattern mining discovers recurring ordered patterns within a collection of sequences. A common form finds subsequences that occur in at least a specified number or proportion of the input sequences, using a minimum-support threshold.

What it means

A sequence might describe a customer's ordered actions, the events in a service case or the symbols in a recorded process. The method looks for patterns such as A followed later by C, rather than only asking whether A and C appear somewhere in the same unordered record.

Order matters, but adjacency is not always required. Under ordinary subsequence matching, other events may occur between the pattern's elements. A particular application can impose time-gap, duration or adjacency constraints, which change the patterns being counted.

Frequent does not mean causal, useful or statistically significant. A common pattern may simply reflect how the system is designed, such as every user needing to log in before completing a task. Mining identifies candidates for interpretation, not ready-made explanations.

How it works

Define the unit of sequence, the event vocabulary and the ordering rule. A sequence may contain ordered itemsets, allowing several items to occur together at one position. Decide how to handle repeated events, session boundaries and missing timestamps.

Set a minimum support and any constraints. In the common sequence-support definition, a pattern's support is the number of input sequences containing it, not the total number of times it can be matched within those sequences.

Algorithms search efficiently through possible patterns. Candidate-generation methods expand and test patterns, while pattern-growth methods such as PrefixSpan use projected sequence databases to extend frequent prefixes. Many variants target closed, maximal or constrained patterns to manage the output.

Interpret discovered patterns using their frequency, baseline context and stability in other data. Keep discovery separate from evaluating whether a pattern predicts an outcome or whether changing an earlier event would cause a later one.

Three practical examples

  • A service team mines recurring event sequences before cases are escalated, then investigates whether the patterns reveal a process issue.
  • A website analyst examines common navigation subsequences without assuming that each preceding page causes the next action.
  • An AI operations team searches tool-call logs for repeated workflows and reviews whether the patterns reflect intended processes or repeated recovery attempts.

Think of it this way

Think of looking through many playlists for songs that tend to appear in the same order. A pattern can be present even if other songs occur between its elements, depending on the matching rule.

The analogy has limits because event sequences can include simultaneous itemsets and time constraints. A frequent order also does not explain why the sequence occurs or guarantee that the next song, or business event, will follow.

Worked example

Consider four invented sequences: S1 = A, B, C; S2 = A, C; S3 = B, A, C; and S4 = A, B, A, C. Use ordered subsequences with gaps allowed and count each supporting sequence once.

The pattern A then C occurs in all four sequences, so its support is 4 out of 4, or 100%. B then C occurs in S1, S3 and S4, giving 75%. A then B then C occurs in S1 and S4, giving 50%.

At a minimum support of 75%, the first two patterns qualify and the third does not. The repeated A in S4 does not make that sequence contribute twice to the support of A then C.

If the rule required adjacent events, A then C would not occur in S1. This illustrates why the sequence definition and matching constraints must accompany a reported support value.

Illustrative case study

Illustrative fictional case: Riverbank Help mines user-action logs and finds that viewing a troubleshooting page is often followed by contacting support. A draft recommendation suggests removing the page to reduce support demand.

The analyst notes that people with difficult problems may be more likely both to view the page and to contact support. The pattern establishes an observed order, not the effect of removing the page. The team examines problem types, page usefulness and the data-collection process before proposing a test.

It also checks whether automated redirects create part of the sequence. This fictional case shows how a frequent pattern can generate a useful question without justifying an unsupported intervention.

Common misconceptions and mistakes

Do not confuse sequential patterns with unordered frequent itemsets. Do not assume “followed by” means immediately next unless adjacency is part of the definition.

Avoid interpreting support as confidence, causal effect or statistical significance. Do not count multiple matches within one sequence as multiple supporting sequences when using standard sequence support. Very low thresholds can produce huge collections of overlapping patterns, while high thresholds can omit rare but important processes.

Business use

Use sequential pattern mining when ordered behavior matters and the event records are sufficiently consistent. Define sequence boundaries and event meanings before choosing an algorithm.

Review common patterns against process knowledge and compare their stability across periods or held-out sequences. If the goal is prediction, evaluate a predictive model separately. If the goal is process improvement, investigate mechanisms and intervention effects rather than assuming that deleting a frequent predecessor will remove an undesirable outcome. AI summaries should preserve the exact order and gap rules instead of turning a subsequence into a claim about immediate next actions.

People also ask

Does a sequential pattern have to occur contiguously?

Not under the usual subsequence definition, which permits gaps. Some tasks impose adjacency or time constraints explicitly.

Is support the number of occurrences?

Commonly it is the number or proportion of sequences containing the pattern. Other mining tasks use different occurrence measures, so the definition must be stated.

Does a frequent sequence predict what a particular user will do next?

Not by itself. A frequency pattern can inform a model, but next-event prediction requires its own assumptions and evaluation.

Check your understanding

One customer performs A then B five times, while nine other customers never do. Under sequence-level support with one sequence per customer, is support 50%?

Answer: No. Only one of ten customer sequences contains the pattern, so support is 10%. Repeated matches inside that sequence do not increase this support count.

Related terms

  • Sequence
  • subsequence
  • support
  • PrefixSpan
  • frequent pattern
  • association rule
  • event log
  • process mining
  • next-event prediction

Learn next

Read subsequence and frequent itemset mining. Count pattern support manually in four short sequences, then repeat with an adjacency requirement. Explain why the resulting frequencies differ and which definition best fits the process question.

More in Data science and analytics

  • Sample Standard Deviation - The sample standard deviation measures the spread of observed numerical values around their sample mean.
  • Scatter plot - A scatter plot displays paired numerical values as points on two axes.
  • Sequence analysis in social sciences - Sequence analysis in the social sciences studies ordered histories of states or events to understand how social processes unfold.
  • Seriation (statistics) - Seriation is the arrangement of objects into an order that reveals structure in their data or relationships.
  • Set - A set is a collection of distinct elements.
  • Shallow Copy - A shallow copy creates a new outer object while retaining references to the objects held inside it.

Sources

Pei and colleagues, Mining Sequential Patterns by Pattern-Growth: The PrefixSpan Approach: https://www.philippe-fournier-viger.com/spmf/prefixspan.pdf

Philippe Fournier-Viger, introduction to sequential pattern mining: https://data-mining.philippe-fournier-viger.com/an-introduction-to-sequential-pattern-mining/

SPMF, sequential-pattern algorithms and constrained variants: https://www.philippe-fournier-viger.com/spmf/documentation_218.php

The four sequences and help-service case are original fictional illustrations.

Previous: Sequential Monte Carlo approximate Bayesian computation Next: Sequential probability ratio test

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer