Association Analysis in Data Mining
Association analysis — finding "if this, then that" relationships between items, along with the support, confidence, and lift measures used to score them — is covered with a full worked example in the lesson on association rule mining, and the Apriori and FP-Growth algorithms that find these relationships at scale are covered in their own dedicated lessons, with Eclat and quantitative (numeric-attribute) rules covered in the lesson on what is association in data mining. This lesson focuses on the one idea from this topic that is genuinely distinct from ordinary association analysis and deserves its own worked example: sequential pattern mining.
Why Sequential Patterns Are a Different Problem, Not a Variant
Ordinary association rules treat a transaction as an unordered set — {Milk, Bread} is the same itemset whether milk or bread was picked up first. Sequential pattern mining asks a question ordinary association analysis cannot answer at all: not just which items tend to occur together, but in what order they tend to occur across a sequence of events. "Customers who buy a computer eventually buy antivirus software" is a claim about order across separate purchases over time, not about items appearing together in a single transaction — which means it needs an algorithm that treats sequence position as meaningful, rather than one built to intersect or count unordered itemsets.
A Worked Example: Finding a Frequent Sequential Pattern
Take three customers' purchase sequences, each listed in the order the purchases occurred:
Customer 1: {Computer} -> {Printer} -> {Antivirus}
Customer 2: {Computer} -> {Antivirus}
Customer 3: {Computer} -> {Printer}
To find a frequent sequential pattern, check how many of the 3 customers' sequences contain a candidate ordered pattern as a subsequence (not necessarily consecutively — a match just has to preserve the relative order):
Candidate <Computer, Antivirus>:
Customer 1: Computer occurs before Antivirus -> matches
Customer 2: Computer occurs before Antivirus -> matches
Customer 3: no Antivirus at all -> does not match
Support = 2 / 3 ≈ 0.67
Candidate <Computer, Printer>:
Customer 1: Computer occurs before Printer -> matches
Customer 2: no Printer at all -> does not match
Customer 3: Computer occurs before Printer -> matches
Support = 2 / 3 ≈ 0.67
With a minimum support threshold of 0.5, both <Computer, Antivirus> and <Computer, Printer> qualify as frequent sequential patterns, even though no single customer bought all three items and the two patterns describe two different orderings that partially overlap. Notice what an ordinary (order-blind) association rule would have missed here: it would report {Computer, Printer, Antivirus} as one itemset with a single support value based on co-occurrence alone, collapsing two distinct three-step and two-step sequences into one unordered set and losing the fact that antivirus purchases specifically follow, rather than precede, the computer purchase.
Where This Leaves Sequential Pattern Mining
Real sequential-pattern algorithms — GSP (Generalized Sequential Pattern) being the classic example — extend this same counting logic with the downward-closure principle already covered in the lesson on association rule mining (if a sequence isn't frequent, no longer sequence containing it can be either), applied to ordered subsequences instead of unordered subsets. The core relationships (support, confidence, lift) and the algorithms that scale itemset counting to large datasets (Apriori, FP-Growth, Eclat) remain exactly as covered in their dedicated lessons — sequential pattern mining simply answers a question those algorithms were never designed to answer: not just what occurs together, but what tends to happen next.