IT603(B) • Data Mining • Unit III

Association Rule Mining, Apriori and FP-Growth

Complete RGPV exam-oriented notes on frequent itemsets, support, confidence, lift, Boolean and multilevel association rules, Apriori algorithm, FP-tree construction, time-series association rules and current trends.

Start Unit 3 Notes

1. Association Rule Mining 14 Marks

Association rule mining is a data-mining technique used to discover interesting relationships, correlations and co-occurrence patterns among items in large transactional databases.

General Form

X → Y

Here, X and Y are itemsets and X ∩ Y = ∅. The rule means that when X occurs in a transaction, Y is also likely to occur.

Example: Bread → Butter means customers who buy bread may also buy butter.

Main Objective

  • Discover frequently occurring item combinations.
  • Generate useful if-then relationships.
  • Support recommendation and business decisions.
  • Understand customer purchasing behavior.

Market Basket Analysis

Association rules are widely used in market basket analysis to study products purchased together.

Transaction Database | Frequent Itemset Mining | Rule Generation | Interesting Association Rules

2. Basic Terminology 14 Marks

Item

A single object or product, such as milk or bread.

Itemset

A collection of one or more items.

{Milk, Bread} is a 2-itemset.

Transaction

A set of items purchased or occurring together.

k-Itemset

An itemset containing exactly k items.

Frequent Itemset

An itemset whose support is equal to or greater than minimum support.

Candidate Itemset

A possible frequent itemset generated during an algorithm.

Antecedent and Consequent

In X → Y, X is the antecedent and Y is the consequent.

Transaction IDItems
T1Milk, Bread, Butter
T2Bread, Diaper, Beer
T3Milk, Bread, Diaper, Beer
T4Milk, Bread, Diaper, Butter

3. Support, Confidence and Lift 14 Marks

Support

Support measures how frequently an itemset or rule appears in the database.

Support(X → Y) = Count(X ∪ Y) / Total Transactions

Confidence

Confidence measures how often Y occurs in transactions containing X.

Confidence(X → Y) = Support(X ∪ Y) / Support(X)

Lift

Lift measures whether X and Y occur together more often than expected if they were independent.

Lift(X → Y) = Confidence(X → Y) / Support(Y)

Interpretation of Lift

  • Lift > 1: positive association.
  • Lift = 1: X and Y are independent.
  • Lift < 1: negative association.
Suppose 4 out of 10 transactions contain Bread and 3 of those also contain Butter. Support(Bread → Butter) = 3/10 = 30%. Confidence(Bread → Butter) = 3/4 = 75%.

Strong Association Rule

A rule is considered strong when it satisfies both minimum support and minimum confidence.

4. Association Rule Mining Process 14 Marks

Two Main Steps

Step 1: Frequent Itemset Generation

Find all itemsets whose support is greater than or equal to the minimum support threshold.

Step 2: Rule Generation

Generate association rules from frequent itemsets and retain rules satisfying minimum confidence.

Transactional Database | Set Minimum Support | Generate Frequent Itemsets | Set Minimum Confidence | Generate Strong Rules | Evaluate using Lift and Other Measures

Why Separate These Steps?

Frequent-itemset generation is usually the most computationally expensive task. Once frequent itemsets are available, rule generation is comparatively simpler.

5. Single-Dimensional Boolean Association Rules 14 Marks

A single-dimensional Boolean association rule contains only one predicate or dimension, and each item is represented as present or absent.

Example

buys(Customer, Bread) → buys(Customer, Butter)

Why Boolean?

The rule checks only whether an item occurs, not its quantity or numeric value.

Single Dimension

The rule uses one type of predicate, such as buys.

Characteristics

  • Uses binary presence or absence.
  • Mostly used in transaction databases.
  • Easy to interpret.
  • Common in market basket analysis.

Boolean Transaction Representation

TransactionMilkBreadButter
T1111
T2010
T3110

6. Multi-Level Association Rules 14 Marks

Multi-level association rules discover relationships at different levels of a concept hierarchy.

Concept Hierarchy Example

Food ├── Dairy │ ├── Milk │ └── Cheese └── Bakery ├── Bread └── Cake

Rules at Different Levels

Dairy Product → Bakery Product
Milk → Bread

Approaches

Uniform Minimum Support

The same minimum support is used at every concept level.

Reduced Minimum Support

Lower-level items use a smaller minimum support because they occur less frequently.

Challenges

  • Too many rules may be generated.
  • Low-level rules may have low support.
  • Redundant rules can appear across hierarchy levels.
  • Correct threshold selection is difficult.
Higher-level rules are more general, while lower-level rules are more specific.

7. Apriori Algorithm 14 Marks

Apriori is a level-wise frequent-itemset mining algorithm that uses the Apriori property to reduce the search space.

Apriori Property

Every non-empty subset of a frequent itemset must also be frequent.

Contrapositive Form

If an itemset is infrequent, all of its supersets must also be infrequent.

Main Steps

  1. Scan the database and find frequent 1-itemsets.
  2. Join frequent (k−1)-itemsets to create candidate k-itemsets.
  3. Prune candidates having an infrequent subset.
  4. Scan the database and count candidate support.
  5. Keep candidates satisfying minimum support.
  6. Repeat until no new frequent itemset is found.
Database Scan | Frequent 1-Itemsets L1 | Join + Prune | Candidate 2-Itemsets C2 | Support Counting | Frequent 2-Itemsets L2 | Repeat for k = 3, 4, ...

Apriori Pseudocode

L1 = frequent 1-itemsets for (k = 2; L(k-1) is not empty; k++) { Ck = apriori_gen(L(k-1)) for each transaction t { increment count of candidates in Ck contained in t } Lk = candidates in Ck with minimum support } return union of all Lk

8. Apriori Algorithm Example 14 Marks

Consider the following database with minimum support count = 2.

TIDItems
T1A, B, C
T2A, C
T3A, D
T4B, C
T5A, B, C

Step 1: Frequent 1-Itemsets

ItemSupport CountStatus
A4Frequent
B3Frequent
C4Frequent
D1Removed

Step 2: Candidate 2-Itemsets

CandidateSupport CountStatus
{A,B}2Frequent
{A,C}3Frequent
{B,C}3Frequent

Step 3: Candidate 3-Itemset

CandidateSupport CountStatus
{A,B,C}2Frequent

Final Frequent Itemsets

{A}, {B}, {C} {A,B}, {A,C}, {B,C} {A,B,C}

9. Generating Association Rules 14 Marks

After finding frequent itemsets, rules are generated from their non-empty subsets.

Example from {A, B, C}

A → BC B → AC C → AB AB → C AC → B BC → A

Rule Selection

For every possible rule, calculate confidence and retain only those that satisfy minimum confidence.

Confidence(A B → C) = Support(A B C) / Support(A B)

Rule Pruning

If a rule does not satisfy minimum confidence, some related rules can be eliminated without complete evaluation.

10. Advantages and Limitations of Apriori 14 Marks

Advantages

  • Simple and easy to understand.
  • Uses effective downward-closure pruning.
  • Produces complete frequent itemsets.
  • Works well for small and moderately dense datasets.

Limitations

  • Requires repeated database scans.
  • Generates a large number of candidate itemsets.
  • Can be slow for low support thresholds.
  • Memory usage increases with candidates.
  • Performs poorly on long frequent patterns.
The main Apriori bottlenecks are candidate generation and multiple database scans.

11. FP-Growth Algorithm 14 Marks

FP-Growth is a frequent-pattern mining algorithm that compresses the database into an FP-tree and mines patterns without candidate generation.

Main Idea

  • Scan the database only twice.
  • Store frequent items in a compact tree.
  • Use divide-and-conquer mining.
  • Avoid candidate-itemset generation.

Major Steps

  1. Scan the database and find frequent 1-items.
  2. Sort frequent items by descending support.
  3. Scan transactions again.
  4. Remove infrequent items and arrange items in support order.
  5. Insert transactions into the FP-tree.
  6. Build conditional pattern bases.
  7. Construct conditional FP-trees.
  8. Generate frequent patterns.
Database | Frequent Item List | Ordered Transactions | FP-Tree | Conditional Pattern Bases | Conditional FP-Trees | Frequent Patterns

12. FP-Tree Construction 14 Marks

FP-Tree Components

  • Root: a null node.
  • Item nodes: store item name and count.
  • Header table: stores frequent items.
  • Node links: connect nodes containing the same item.

Example Ordered Transactions

T1: A, C, B T2: A, C T3: A T4: C, B T5: A, C, B

Simplified FP-Tree

Null / \ A:4 C:1 | | C:3 B:1 | B:2

Compression

Transactions sharing common prefixes use the same tree path, reducing storage.

The ordering of items by support increases prefix sharing and improves compression.

13. Mining the FP-Tree 14 Marks

Conditional Pattern Base

A collection of prefix paths ending with a selected suffix item.

Conditional FP-Tree

A smaller FP-tree built from the conditional pattern base of an item.

Mining Process

  1. Start from the least frequent item in the header table.
  2. Collect all prefix paths containing that item.
  3. Create its conditional pattern base.
  4. Remove items below minimum support.
  5. Construct a conditional FP-tree.
  6. Combine the suffix item with patterns in the conditional tree.
  7. Repeat recursively.
Suffix Item B | Prefix Paths Ending in B | Conditional Pattern Base | Conditional FP-Tree | Patterns: {B}, {A,B}, {C,B}, {A,C,B}

Advantages

  • No candidate generation.
  • Only two full database scans.
  • Efficient for dense datasets.
  • Good for long patterns.

Limitations

  • FP-tree construction can be complex.
  • Tree may become large for sparse data.
  • Incremental updates are difficult.

14. Apriori vs FP-Growth 14 Marks

FeatureAprioriFP-Growth
Main approachCandidate generationPattern-growth approach
Database scansMultiple scansUsually two full scans
Data structureCandidate itemsetsFP-tree
PerformanceSlower on large dense dataUsually faster
Memory issueLarge candidate setsLarge tree in some datasets
ImplementationSimplerMore complex
Best useSmall or sparse datasetsLarge or dense datasets
FP-Growth improves over Apriori by eliminating candidate generation and reducing database scans.

15. Time-Series Mining Association Rules 14 Marks

Time-series association rule mining discovers relationships among events or values that occur in temporal order or within specified time intervals.

Examples

  • A rise in temperature is followed by increased electricity demand.
  • A product promotion is followed by higher sales within seven days.
  • A stock-price movement is associated with a later trading pattern.

Types of Temporal Association Rules

  • Time-constrained association rules
  • Sequential association rules
  • Periodic association rules
  • Lagged association rules
  • Trend-based rules

General Form

Event X at time t → Event Y within time interval Δt

Steps

  1. Collect time-stamped data.
  2. Order records by time.
  3. Create time windows or sequences.
  4. Generate temporal itemsets.
  5. Calculate temporal support and confidence.
  6. Evaluate periodicity, lag and trend.

Challenges

  • Choosing an appropriate time window
  • Irregular time intervals
  • Noise and missing observations
  • Changing patterns over time

17. Applications of Association Rule Mining 14 Marks

  • Retail: market basket analysis and shelf arrangement.
  • E-commerce: product recommendations and cross-selling.
  • Healthcare: symptom and disease associations.
  • Banking: fraud and transaction-pattern analysis.
  • Telecommunication: service usage and churn patterns.
  • Web mining: page co-visit analysis.
  • Education: relationships among learning activities and results.
  • Manufacturing: fault and component failure relationships.

18. Challenges in Association Rule Mining 14 Marks

  • Very large number of possible itemsets.
  • Selection of support and confidence thresholds.
  • Generation of redundant or obvious rules.
  • Handling rare but important patterns.
  • Processing high-dimensional data.
  • Mining dynamic and streaming data.
  • Privacy and security concerns.
  • Evaluating usefulness beyond support and confidence.

Interestingness Measures

Measures such as lift, conviction, leverage and correlation help identify more meaningful rules.

Unit 3 Quick Revision

  • Association rules have the form X → Y.
  • Support measures frequency.
  • Confidence measures rule reliability.
  • Lift measures association strength relative to independence.
  • A frequent itemset satisfies minimum support.
  • Apriori uses the downward-closure property.
  • Apriori generates and prunes candidate itemsets.
  • FP-Growth avoids candidate generation.
  • An FP-tree compresses transactions using shared prefixes.
  • Multi-level rules use concept hierarchies.
  • Time-series rules include temporal order and time windows.
  • High-utility, rare, negative and streaming rules are important modern trends.

Important RGPV Exam Questions

Long Answer Questions

  1. Define association rule mining and explain support, confidence and lift.
  2. Explain the complete association rule mining process.
  3. What are single-dimensional Boolean association rules?
  4. Explain multi-level association rules with a concept hierarchy.
  5. State and explain the Apriori property.
  6. Explain the Apriori algorithm with pseudocode.
  7. Solve a transactional database using the Apriori algorithm.
  8. Explain candidate generation and pruning in Apriori.
  9. Discuss the advantages and limitations of Apriori.
  10. Explain the FP-Growth algorithm with a neat diagram.
  11. Explain FP-tree construction with an example.
  12. What are conditional pattern bases and conditional FP-trees?
  13. Compare Apriori and FP-Growth.
  14. Explain time-series association rule mining.
  15. Discuss recent trends in association rule mining.

Short Answer Questions

  1. Define frequent itemset.
  2. What is minimum support?
  3. Define confidence.
  4. What is lift?
  5. State the Apriori property.
  6. What is candidate pruning?
  7. Define FP-tree.
  8. What is a conditional pattern base?
  9. What is a multilevel association rule?
  10. Define a temporal association rule.
Exam Strategy: Always write formulas for support, confidence and lift. For Apriori, show C1, L1, C2, L2 and further levels. For FP-Growth, draw an FP-tree and explain conditional pattern bases.

Download Study Resources

Unit 3 PDF

Printable detailed notes will be uploaded soon.

Coming Soon

Algorithm Practice

Apriori and FP-tree solved examples coming soon.

Coming Soon

PYQ Analysis

Repeated association-mining questions coming soon.

Coming Soon

Frequently Asked Questions

It discovers useful relationships and co-occurrence patterns among items in large datasets.
Every non-empty subset of a frequent itemset must also be frequent.
FP-Growth avoids candidate generation and usually requires only two complete database scans.
It indicates a positive association between the antecedent and consequent.
It is a rule discovered at one or more levels of a concept hierarchy, such as Dairy to Bakery or Milk to Bread.