Project 06-03-01: Itemsets and Association Rules¶
Overview¶
This project implements the core concepts of frequent pattern mining from scratch: support counting, frequent itemset discovery using the Apriori algorithm, and association rule generation with support, confidence, and lift metrics.
Concepts Covered¶
- Itemsets: sets of items found together in transactions
- Support: how frequently an itemset appears (absolute and relative)
- Frequent Itemsets: itemsets whose support exceeds a minimum threshold
- Apriori Property: if X is infrequent, all supersets of X are infrequent (pruning)
- Association Rules: X -> Y relationships mined from frequent itemsets
- Confidence: P(Y | X) = how reliably Y follows X
- Lift: Confidence / Support(Y) — >1 means positive correlation
Dataset¶
The Friends Cuisine dataset: 10 transactions with items from {Indian, Mediterranean, Oriental, Arabic, FastFood}. Used with min_support=3, min_confidence=0.5.
Files¶
association_rules.py— complete from-scratch implementationproject_README.md— this file
How to Run¶
No external libraries required. Pure Python standard library.Expected Output¶
- All frequent itemsets with their support counts
- All association rules sorted by lift (highest first)
- Summary statistics