Database Systems · UGC NET: Data Mining
Association Rules
Overview
Association rule mining discovers items or events that occur together frequently in a transactional database. Its classic application is market-basket analysis: finding products that customers buy together.
It is an unsupervised, descriptive data-mining task because no class label is used while mining.
In UGC NET, this topic is asked through definitions, support-confidence-lift numericals, Apriori candidate generation, FP-growth, closed/maximal itemsets, and statement/match-list questions.
Before studying it, know basic set notation, transaction tables, fractions, and the idea of conditional probability.
Key concepts
- Convention used here: items in an itemset are written in lexicographic order; a rule is with non-empty disjoint itemsets and ; support is a fraction unless called support count.
- A transaction database has transactions; each transaction is a subset of the item universe . An itemset is any subset of ; a k-itemset has items.
- Support count is the number of transactions containing itemset . Support is . An itemset is frequent if its support is at least the user-given minimum support .
- An association rule states co-occurrence, not causality. Its support is the support of ; its confidence is the conditional frequency of among transactions containing .
- Minimum confidence filters rules after frequent itemsets are found. A rule is strong if it satisfies both and .
- Apriori property: every non-empty subset of a frequent itemset is frequent; equivalently, every superset of an infrequent itemset is infrequent. This is the anti-monotonicity of support.
- Candidate generation: from frequent -itemsets , join pairs that share the first items; then prune a candidate if any of its -subsets is not in .
- Rule generation: for a frequent itemset , form rules , where is a non-empty proper subset of .
If a rule with consequent fails , then for the same , every rule with a superset of as consequent also fails; smaller consequents must still be checked. - FP-growth uses an FP-tree and a header table. It scans the database twice, avoids candidate generation, and mines frequent itemsets through conditional pattern bases and conditional FP-trees.
- Closed frequent itemset: frequent itemset with no proper superset having the same support. Maximal frequent itemset: frequent itemset with no frequent proper superset.
Every maximal frequent itemset is closed, but a closed itemset need not be maximal. - Lift checks dependence. means independence; positive association; negative association. High confidence alone can mislead if the consequent is already very frequent.
- Eclat uses vertical transaction-id lists and intersections; CHARM mines closed itemsets. Association mining is used in cross-selling, link analysis, recommender systems, and market-basket analysis.
- Apriori is not supervised; it does not use class labels. Classification is supervised, and clustering is unsupervised but groups objects rather than finding co-occurrence rules.
How it works
Apriori algorithm
- Scan , count every 1-itemset, and keep those with support at least as .
- For , generate candidate -itemsets by self-joining : join two -itemsets if their first items are identical.
- Prune each candidate if any of its -subsets is absent from .
- Scan , count support of remaining candidates, and keep those meeting as .
- Repeat until no new frequent itemsets are found.
- For each frequent itemset , generate rules and keep those meeting . Use the confidence pruning rule carefully: a failed large consequent does not eliminate a smaller consequent.
FP-growth algorithm
- Scan , count item supports, discard infrequent items, and sort frequent items in descending support order.
- Scan again and insert each transaction’s frequent items into an FP-tree in that order; shared prefixes share nodes, and counts increase.
- For each item in the header table, collect its conditional pattern base: the prefix paths ending at that item with their counts.
- Build a conditional FP-tree, removing items whose support falls below , and mine recursively.
- Output frequent itemsets; generate association rules and test confidence as in Apriori.
Drawing the diagram…
Formulas
-
Let , and let be the number of transactions containing itemset .
-
-
-
-
-
-
-
Frequent itemset condition: .
-
Strong rule condition: and .
-
Apriori property: if and is infrequent, then is infrequent; equivalently, if is frequent, every is frequent.
-
For a fixed frequent itemset , if , then . Thus larger consequents have no greater confidence.
-
A frequent -itemset can produce at most non-empty proper rules.
Worked examples
Example 1: support, confidence, lift. Five transactions are:
| Transaction | Customer | Items |
|---|---|---|
| T1 | Ramesh | Milk, Bread, Butter |
| T2 | Geeta | Milk, Bread |
| T3 | Pinki | Milk, Butter |
| T4 | Ankur | Bread, Butter |
| T5 | Sunita | Milk, Bread, Butter |
Counts: Milk , Bread , Milk and Bread . For Milk Bread:
- Support .
- Confidence .
- Lift .
Answer: support , confidence , lift . Since lift is below 1, the items are slightly negatively associated despite high confidence.
Example 2: Apriori candidate generation. Suppose . To form , join pairs sharing the first two items:
- and join to .
- and join to .
Prune using 3-subsets:
- : subsets are all in , so keep.
- : subsets include and , not in , so discard.
Answer: .
Example 3: rule confidence and pruning. For a frequent itemset , let , , , . Let .
- : confidence , fails.
- : confidence , passes.
- : confidence , fails.
The failed rule tells us that any rule with a larger consequent, such as , also fails. It does not eliminate , whose consequent is smaller. Answer: among these three, only is strong.
Example 4: match-the-list. Match List-I with List-II.
| List-I | List-II |
|---|---|
| A. Confidence of | i. fraction of transactions containing both and |
| B. Lift of | ii. confidence divided by support of |
| C. Support of | iii. |
| D. Apriori property | iv. every subset of a frequent itemset is frequent |
Answer: A-iii, B-ii, C-i, D-iv.
Comparison
| Measure | Formula | Symmetric? | Main trap |
|---|---|---|---|
| Support | Yes | Not support of plus support of | |
| Confidence | No | Denominator is antecedent support | |
| Lift | Yes | Lift 1 means independence, not high confidence |
| Itemset type | Definition | Relationship |
|---|---|---|
| Frequent | support at least | Largest collection |
| Closed frequent | frequent and no proper superset with same support | Contains all maximal itemsets |
| Maximal frequent | frequent and no frequent proper superset | Every maximal is closed |
| Apriori | FP-growth |
|---|---|
| Generates candidate itemsets | Avoids candidate generation |
| Multiple database scans | Two database scans |
| Simple but costly at low support | Uses FP-tree and conditional FP-trees |
| At very low support frequent itemsets increase | Can also become memory-heavy for large trees |
| Association | Classification | Clustering |
|---|---|---|
| Unsupervised | Supervised | Unsupervised |
| Finds co-occurrence rules | Predicts a discrete label | Groups similar objects |
| Example: cross-selling | Example: decision tree | Example: k-means |
Revision summary
- Support is a fraction of all transactions; support count is an integer.
- Rule support is support of , never .
- Confidence denominator is , the antecedent.
- Lift : independence; lift : positive association; lift : negative association.
- High confidence with a very frequent consequent can still be misleading; check lift.
- Apriori property: frequent itemset’s subsets are frequent; infrequent itemset’s supersets are infrequent.
- Apriori join uses pairs sharing the first items.
- FP-growth scans the database twice and builds an FP-tree; it does not generate candidates.
- Low increases the number of frequent itemsets and usually makes Apriori costly.
- Maximal implies closed; closed does not imply maximal.
- Apriori is unsupervised; association mining is used for cross-selling and link analysis.
- A frequent -itemset has at most non-empty proper rules.
Previous-year exam insights
- Direct questions ask definitions of support, confidence, lift, Apriori property, closed itemset, and maximal itemset.
- Numeric questions give a transaction table and ask support, confidence, or lift; compute counts first, then fractions.
- Statement I/II questions compare Apriori and FP-growth, low-support behaviour, and supervised versus unsupervised nature.
- Candidate-generation questions give and ask for ; apply the join step, then prune using missing 3-subsets.
- Match-list questions pair terms with formulas or roles: confidence, lift, support, Apriori property.
- Trap: high confidence does not imply positive lift; confidence alone can be misleading.
- Trap: at very low support the number of frequent itemsets becomes larger, not smaller; Apriori becomes expensive.
- Trap: FP-growth avoids candidate generation, but it still scans the database twice and builds conditional trees.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- Define support, confidence, and lift and write their formulas without confusion.
- Compute support count, support, confidence, and lift from a small transaction table.
- State and apply the Apriori property in both directions.
- Generate from using the join step and prune invalid candidates.
- Explain why FP-growth avoids candidate generation and list its two database scans.
- Distinguish frequent, closed, and maximal frequent itemsets with examples.
- Explain why high confidence may still be misleading and when lift equals 1.
- Solve statement I/II and match-list questions on association mining terms.
- Identify association mining applications such as cross-selling and link analysis.
- Explain why Apriori is unsupervised and why it is not classification.
Attempt the PARIKSHA sub-topic test first, then take the subject test.