Back to Study Material Machine Learning

Association rule learning

Association rule learning is an unsupervised technique for discovering interesting relationships between variables in large transactional datasets. It is m...

Association rule learning

Discovering Co-occurrence Patterns in Transactions

Association rule learning is an unsupervised technique for discovering interesting relationships between variables in large transactional datasets. It is most commonly associated with market basket analysis — finding which products are frequently purchased together — but applies broadly to any domain with transaction-style data.

An association rule takes the form "if antecedent then consequent." A classic example: customers who buy bread and butter also frequently buy jam. Three metrics evaluate the quality of a rule. Support is the proportion of transactions containing all items in the rule — it measures how frequently the pattern occurs. Confidence is the proportion of antecedent transactions that also contain the consequent — it measures how reliable the rule is. Lift is the ratio of observed support to expected support if the items were independent — values above 1 indicate that the items appear together more than by chance.

The Apriori algorithm is the classical approach. It first identifies all itemsets whose support exceeds a minimum threshold (frequent itemsets). It then generates rules from frequent itemsets and filters by minimum confidence. The Apriori property prunes the search space: if an itemset is infrequent, all its supersets are also infrequent and need not be evaluated. The FP-Growth algorithm is a more efficient alternative that compresses transactions into a tree structure, avoiding repeated dataset scans.

Association rules can surface non-obvious relationships. A famous example from retail analytics found that diapers and beer were frequently purchased together on Friday evenings — possibly new fathers doing a weekly shop. Such insights can inform shelf placement and promotions.

A concrete example: an online bookstore applies association rule learning to purchase histories. The rule "fantasy novels → maps and atlases" has support of 0.03, confidence of 0.45, and lift of 4.2, suggesting a genuine affinity worth targeting with cross-sell recommendations.

Exam tip: know all three metrics (support, confidence, lift) and be able to explain what each measures and why lift is more informative than confidence alone.