- Introduced by
- Cheung, D. W., Han, J., Ng, V. T., & Wong, C. Y.
- Year
- 1996
- Type
- Incremental / streaming pattern mining
- Family
- Machine learning
What does it do?
Online association rule mining discovers if-then patterns, such as buying bread implying buying butter, from transactional data that arrives incrementally or as a stream.
It updates item counts and existing rules as new records arrive, so the full historical database does not have to be re-scanned after each batch.
The intuition behind the method
Batch association rule mining scans the full set of transactions to find frequent itemsets, which becomes costly when new data keeps arriving. Online variants keep running support counts for itemsets and revise them as transactions are added or, in variants that support it, removed. When a batch arrives, the affected counts are updated, rules are checked against the minimum support and confidence thresholds, rules that no longer qualify are dropped, and newly frequent patterns are promoted to rules. The aim is to track the rule set a batch run would produce on the current data while re-reading the historical data only when necessary.
History
Incremental association rule mining is associated with the 1996 ICDE paper by Cheung, Han, Ng, and Wong, which introduced the FUP (Fast UPdate) algorithm for maintaining discovered rules as the database grows. This page covers exact incremental maintenance of association rules; approximate streaming variants and concept-drift methods are outside its scope.
When to use it
Choose online association rule mining when transactions or events arrive continuously or in frequent batches and the rule set must stay current without repeated full passes over the history. Typical cases are basket analysis on a live retail feed, clickstream pattern tracking, or monitoring of event logs. It can also suit settings where storage limits make repeated batch runs over the full history impractical, although newly frequent candidates may still need past transactions to obtain exact counts. Do not use it when the data is static and fits in memory: batch Apriori or FP-growth is simpler to implement and should yield the same rules on the same data. Be cautious when the underlying pattern changes substantially over time and no forgetting mechanism, such as a window or decay, is available, because stale counts then distort rule quality.
Limitations and considerations
- Support counts for a large, evolving candidate set can still consume substantial memory.
- Without a forgetting mechanism, counts accumulate over time, so older patterns can keep outranking emerging ones.
- Implementation is more involved than batch Apriori or FP-growth, because count maintenance and threshold-crossing logic must be correct.
- Minimum support and confidence thresholds still have to be chosen by hand for each dataset.
- A very wide transaction space can still produce a large number of candidate itemsets.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Limits repeated full passes over historical data when new transactions arrive, so each update is driven mainly by the new batch.
- Keeps the rule set aligned with recent transactions, which supports real-time recommendation or alerting.
- Handles insertions directly; deletions are supported only by variants that implement decremental count updates.
- May reduce the need to keep the full history for repeated batch runs; however, count structures grow with the candidate set, and newly frequent candidates may still require past data to obtain exact counts.
- Can be combined with sliding-window or time-decay weighting to favour recent patterns.
Applications
- Real-time retail market basket analysis for dynamic product recommendation.
- Clickstream pattern mining on e-commerce or content platforms with continuous user activity.
- Network security and intrusion detection using event-log streams.
- Medical record monitoring where new patient encounters continuously enrich the transaction database.
- Financial transaction surveillance for fraud pattern detection.
- IoT sensor event correlation in industrial or smart-home systems.
How it works
How it works
The algorithm keeps current support counts for the candidate itemsets it has seen so far, stored in an internal index whose form depends on the implementation. As transactions arrive, the counts of the itemsets they contain are incremented. If a transaction is deleted and the variant supports deletion, the corresponding counts are decremented. Itemsets that were not tracked before may require a scan of earlier transactions to obtain their exact counts. With exact counts, the retained rules match those that a batch run with the same thresholds would produce on the same data. Insertions are handled exactly; deletions are handled only by variants that implement decremental updates; approximate count structures are outside the scope of this page.
The support of an itemset X is count(X) divided by N, where N is the number of transactions currently in the database. After each update, the minimum support threshold is applied to the revised supports. Itemsets that reach the threshold for the first time become frequent, and those that fall below it become infrequent. The purpose of incremental maintenance is that mainly these threshold-crossing itemsets need further work, rather than the whole itemset space.
Rules built from itemsets that have fallen below the minimum support threshold, or whose confidence now falls below the minimum confidence threshold, are invalidated and removed. This keeps the active rule set tied to the current data rather than to patterns from earlier batches.
From the set of now-frequent itemsets, new candidate rules are generated and their confidence is computed from the updated counts, where confidence(X ⇒ Y) = support(X ∪ Y) / support(X). Only rules meeting both the minimum support and minimum confidence thresholds are retained and surfaced to the user or downstream application. Each retained rule can also be reported with its lift, defined as confidence(X ⇒ Y) / support(Y), where a value above 1 indicates that X and Y co-occur more often than they would if independent. Conviction, defined as (1 − support(Y)) / (1 − confidence(X ⇒ Y)), is undefined when confidence equals 1.
Formula
\text{confidence}(X \Rightarrow Y) = \frac{\text{support}(X \cup Y)}{\text{support}(X)}Common pitfalls
- Omitting a forgetting or windowing mechanism, so that outdated rules persist and mislead downstream consumers.
- Setting minimum support too low relative to transaction density, which floods the output with rare, weakly supported rules.
- Ignoring rule staleness: a rule with high historical support may have near-zero support in the most recent window.
- Evaluating rule quality using only confidence without also checking lift or conviction, leading to trivial or misleading rules.
- Assuming online ARM is equivalent to running batch Apriori repeatedly; incremental updates are only correct if count maintenance logic is implemented carefully.
Frequently asked questions
How is online association rule mining different from simply re-running Apriori on each new batch?
Re-running Apriori from scratch reads the full historical database on every run, so its cost grows with the accumulated history. Online ARM keeps running counts and updates only the entries affected by new transactions, so the work of each update is driven mainly by the new batch, although maintaining the counts can still be costly when the candidate set is large.
What happens to rules when data is deleted from the database?
Only variants that support decremental updates can decrement counts for deleted transactions. In those variants, rules whose support falls below the minimum threshold after deletion are invalidated and removed. Check whether a given implementation handles deletions before relying on it.
How do I prevent the rule set from being dominated by old, irrelevant patterns?
Apply a sliding window (count only the last N transactions) or an exponential time-decay to counts so that recent transactions have higher weight. This forces old patterns to fade naturally as new data arrives.
Can online association rule mining handle concept drift?
Basic online ARM does not adapt to concept drift automatically. Adding a time-decay weight or a fixed sliding window introduces a form of forgetting that lets the rule set track shifting patterns, but explicit drift-detection hooks are needed for rapid, abrupt shifts.
What are reasonable starting thresholds for minimum support and confidence?
There is no universal starting point, because suitable thresholds depend on the domain and on how densely transactions share items. Start from thresholds that produce a manageable number of rules, then adjust them by inspecting which rules are useful, and check lift or conviction alongside confidence.
Related methods
Sources
Cheung, D. W., Han, J., Ng, V. T., & Wong, C. Y. (1996). Maintenance of discovered association rules in large databases: an incremental updating technique. In Proceedings of the 12th International Conference on Data Engineering (ICDE 1996), pp. 106–114. IEEE.
Open publication referenceAssociation rule learning. Wikipedia.
Open publication reference