association rule learning
/ uh-soh-see-AY-shun rool LER-ning /
Association rule learning digs through piles of transactions to find the unwritten rules of "what goes with what." Its home turf is the supermarket checkout: across millions of receipts, which items keep showing up in the same basket? The famous (if disputed) folklore is "people who buy diapers also tend to buy beer." The output is a set of if-then rules — if a basket contains bread and peanut butter, then it often also contains jam — discovered automatically, with no one labeling anything in advance.
Three numbers keep the rules honest. Support asks how common the combination is overall — a rule about items almost no one buys together is trivia, not insight. Confidence asks, of the baskets that have the first item, what fraction also have the second — how reliable the rule is. And lift asks the crucial question: does the first item actually make the second more likely than chance, or do they just both happen to be popular? A lift above 1 means a genuine pull; a lift near 1 means coincidence. The classic Apriori algorithm finds these rules efficiently using a simple insight: a combination can't be frequent unless all its smaller parts are frequent too, which lets it prune away mountains of hopeless candidates.
It powers recommendation nudges ("frequently bought together"), store-shelf layout, and the analysis of medical symptom co-occurrence. The essential honesty caveat: association is not causation. The rule says these things appear together, not that one causes the other — both might be driven by a third factor (a holiday, a season, a shared shopper type). And with thousands of products, you'll unearth a flood of rules, most of them obvious or accidental; the real skill is sifting the few that are both surprising and actionable from the noise.
Across 100,000 receipts, the rule "chips → salsa" has support 8% (8% of all baskets hold both), confidence 70% (70% of chip-buyers also grab salsa), and lift 3.5 (chip-buyers are 3.5× more likely to buy salsa than a random shopper). High lift means a real link — worth putting the two on the same aisle.
Support, confidence, and lift together tell you whether a rule is real or just popular noise.
Always check lift, not just confidence: a rule can look strong simply because the second item is bought by nearly everyone. And never forget the cardinal warning — these rules reveal co-occurrence, never cause; both items may ride on a hidden third factor.