Course: Data Science and Database Technologies
Professors: Elena Baralis and Silvia Chiusano, Politecnico di Torino, Data Base and Data Mining Group.
Source: Association Rules Fundamentals, local path DSTBD_9-DMassrules.pdf, 98 PDF pages. Lecture number 09 is inferred from the local course sequence and filename order; the PDF itself does not print a lecture number.

Lecture summary

Association rule mining discovers item combinations that occur together in transactional data. The transaction can be a shopping basket, a document, a database row or a context record. A rule such as Diapers → Milk describes co-occurrence, not causation.

The workflow separates two tasks. First, find frequent itemsets using a support threshold. Then split each frequent itemset into possible rules and retain rules meeting a confidence threshold. Support measures how common the whole combination is; confidence measures how often the right-hand side appears when the left-hand side appears; lift compares the rule with the baseline frequency of its right-hand side.

The lecture develops Apriori and FP-growth as two approaches to frequent-itemset generation. Apriori generates candidates level by level and prunes candidates using the fact that an infrequent subset cannot have a frequent superset. FP-growth compresses the database into an FP-tree and mines conditional pattern bases recursively.

Large outputs can be compressed with closed and maximal frequent itemsets. Weighted rules include item or transaction importance. Taxonomies enable generalized rules at high, cross and low abstraction levels, which can reveal patterns that are too rare at the most detailed level.

Learning route

  1. Start with Association Rules Support Confidence and Lift to learn the objects, measures and worked calculations.
  2. Trace Apriori and FP-growth to understand how the search is made computationally feasible.
  3. Finish with Maximal Closed and Generalized Itemsets to understand compact representations and abstraction levels.
  4. Revisit Data Science and the KDD Process and Lecture 08 - Data Preprocessing to place association mining after selection, cleaning and transformation.

Worked examples from the source

Supermarket support and confidence

The source uses five transactions:

TIDItems
1Bread, Coke, Milk
2Beer, Bread
3Beer, Coke, Diapers, Milk
4Beer, Bread, Diapers, Milk
5Coke, Diapers, Milk

Milk plus Diapers appears three times, so its support is 3/5 = 60%.

For Milk → Diapers, Milk appears four times and the pair appears three times, giving confidence 3/4 = 75%. For Diapers → Milk, Diapers appears three times and all three include Milk, giving confidence 3/3 = 100%. The support is the same because both rules use the same pair; the confidence changes because the antecedent changes.

Text and structured data

The lecture treats a document as a transaction and words as items. From documents containing words such as customer, relationship, data and mining, it illustrates a rule customer, relationship → data, mining.

A structured row can also become a transaction by turning each attribute-value pair into an item. The source’s tax-record example gives the rule Refund=No, MaritalStatus=Married → Cheat=No.

Confidence and lift

In the cereal example, 3,750 of 5,000 students eat cereals, 3,000 play basketball and 2,000 do both. The rule play basketball → eat cereals has support 2,000/5,000 = 40% and confidence 2,000/3,000 = 66.7%. Because cereal already has support 3,750/5,000 = 75%, the lift is 0.667/0.75 ≈ 0.89, indicating negative rather than positive association.

Generalization

The source compares a rare context consisting of John, 6:05 p.m. and Weather with a generalized context consisting of employee, 6–7 p.m. and Weather. Replacing a person with a category and an exact time with a period covers more transactions and may expose a useful higher-level pattern.

Source map

PDF pagesMaterial
2-6Association rules, transactional formats and examples
7-12Itemsets, support, confidence and rule extraction
13-20Candidate search, Apriori principle and Apriori algorithm
21-39Worked Apriori run and performance improvements
40-73FP-growth, FP-tree construction and conditional pattern bases
74-80Vertical layouts, compact, maximal and closed representations
81-85Support thresholds, interestingness, confidence limitations and lift
87-91Weights, hierarchies, taxonomies and generalized itemsets
92-98Context-aware and multi-level medical association rules

Common confusions

  • The arrow means co-occurrence, not causation.
  • Support and confidence are different: support counts the whole rule combination; confidence conditions on the antecedent.
  • High confidence can be caused by a very common consequent, so inspect lift.
  • Generalization moves upward to broader categories; it does not add detail.
  • Maximal itemsets are the largest frequent sets; closed itemsets preserve support changes and are usually more informative.

Revision prompts

  • Calculate support and confidence for both directions of a rule from the supermarket table.
  • Explain why an infrequent pair lets Apriori remove every larger set containing that pair.
  • Compare Apriori’s candidate generation with FP-growth’s compressed-tree search.
  • A rule has 80% confidence and its consequent has 90% support. What does lift below 1 suggest?
  • Explain why a high-level medical rule can have higher support than a low-level rule.

Source and scope

Elena Baralis and Silvia Chiusano, Association Rules Fundamentals, Politecnico di Torino, Data Base and Data Mining Group, local path DSTBD_9-DMassrules.pdf, 98 PDF pages. The source’s examples and formulas are paraphrased here; explanatory analogies and the learning route are added study explanations. The original PDF and figures remain local.