Frequent-itemset mining on grocery transaction data using the Eclat algorithm in R.
Eclat (Equivalence Class Transformation) discovers which products are frequently purchased together by scanning a dataset of 7 500 grocery transactions. Unlike Apriori, Eclat uses a depth-first search with set-intersection counting, which is often faster on dense datasets.
- Load transactions from CSV using
arules::read.transactions() - Mine frequent itemsets with a minimum support of 0.3 % and a minimum length of 2
- Rank results by support and display the top 10
| File | Rows | Description |
|---|---|---|
Market_Basket_Optimisation.csv |
7 501 | Each row is one transaction; items are comma-separated |
| Tool | Purpose | |
|---|---|---|
| 📊 | R | Statistical computing |
| 📦 | arules | Association rule / frequent-itemset mining |
# Install the dependency (once)
install.packages("arules")
# Run the script
source("eclat.R")- The CSV has no header row;
read.transactions()handles this correctly, butread.csv()would misinterpret the first transaction as column names.