Lecture: Lecture 09 - Association Rules
The problem
Association rule mining searches transactional data for combinations that occur together. A transaction is an unordered set of items. It can be a basket, document, structured row or context record.
An association rule has the form A → B, where A is the body (antecedent) and B is the head (consequent). The arrow records co-occurrence and does not establish causation.
Support
Support asks how widespread the complete combination is:
support(A → B) = count(A and B) / total transactions
Using the lecture’s five supermarket transactions, Milk plus Diapers appears in transactions 3, 4 and 5:
support = 3/5 = 60%
Support count is the numerator, 3 in this example. An itemset is frequent when its support reaches the chosen minsup threshold.
Confidence
Confidence asks how often B occurs among transactions that contain A:
confidence(A → B) = support(A and B) / support(A)
Milk appears four times and Milk plus Diapers appears three times:
confidence(Milk → Diapers) = 3/4 = 75%
Diapers appears three times and all three also contain Milk:
confidence(Diapers → Milk) = 3/3 = 100%
The two directions have equal support but different confidence because their antecedents have different frequencies.
Lift
Confidence can look high when the consequent is already common. Lift compares the rule with that baseline:
lift(A → B) = confidence(A → B) / support(B)
- Lift greater than 1: positive association.
- Lift equal to 1: independence under this measure.
- Lift less than 1: negative association.
In the source’s student example, 2,000 of 3,000 basketball players eat cereals, so confidence is 66.7%. Since 3,750 of 5,000 students eat cereals, cereal support is 75%. Lift is approximately 0.89, so the rule is weaker than the baseline prediction.
Weighted rules
Unweighted rules count transactions equally. A weighted analysis can give more importance to price, quantity, profit, severity or transaction value. The source describes weighted support and confidence and allows application-specific aggregation such as minimum, maximum or average. The weighting method must match the decision question.
Common confusion
Confidence is conditional probability, not a guarantee. A confidence of 75% means 75 out of 100 relevant antecedent cases in the data also contained the consequent. It does not mean the antecedent causes the consequent.
Retrieval questions
Why can the two directions of a rule have different confidence? Their shared pair has the same count, but their antecedents may occur with different frequencies.
Why inspect lift after confidence? A common consequent can make many rules look strong even when the antecedent does not improve prediction over the baseline.
When might a weighted rule be preferred? When frequency alone ignores the quantity, value or risk that matters for the decision.
Source
Elena Baralis and Silvia Chiusano, Association Rules Fundamentals, PDF pages 2-12 and 81-88. The formulas and examples are paraphrased from the lecture.