Foundations to Frontier
Tests
D. Classical Machine Learning › D12 Association Rule Mining

Eclat

Eclat (Zaki, 2000) mines frequent itemsets from a vertical view of the data. Instead of storing each transaction's items, it stores each item's tid-list, the set of transaction ids that contain it. The support of any itemset is then the size of the intersection of its items' tid-lists, so after one scan to build the lists, Eclat never touches the transactions again. It explores the search space depth-first within prefix-based equivalence classes, joining each itemset's tid-list with those of its siblings. On dense data tid-lists become long, and the dEclat variant stores diffsets instead, the transactions lost when an item is added, which shrink dramatically. Eclat is simple, memory-local and fast, especially with bitmaps, and is the basis of many high-performance miners. This page covers the vertical layout, tid-list intersection, equivalence classes and depth-first search, diffsets and the support recurrence, bitmap implementations, and how Eclat compares with Apriori and FP-Growth. In the exercises you implement Eclat and verify it; then you compare tidset and diffset memory on sparse and dense data.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Turn the table sideways

Instead of listing what is in each basket, list, for each product, which baskets contain it: bread is in baskets 1, 2, 4 and 5; milk is in 1, 3, 4 and 5. How many baskets contain both? Just look for the numbers the two lists share: 1, 4 and 5, so three. Eclat works entirely with these per-item lists, finding every frequent combination by intersecting lists, without reading the baskets again.

Eclat: support by intersecting tid-lists
bread (12)milk (6)eggs (12)coffee (8)sugar (5)butter (8)∩ = 5diffset = 7
itemset bread + milk: support 5/16 · tidset of the prefix 12, diffset 7, so support = 12 − 7
Eclat never rescans the transactions: after one pass to build these rows, every support is an intersection, and depth-first search extends one prefix at a time. On dense data the tid-lists, and their intersections, are long, while the diffsets (what is lost when one item is added) stay short. That is why dEclat stores diffsets on dense data. On sparse data (untick "dense data") the reverse holds.
Why engineers care

Vertical tid-lists map naturally onto bitmaps and SIMD AND operations, which makes Eclat-style mining very fast and cache-friendly. The same representation underlies inverted indexes in search engines, and “which flights had both fault A and fault B” queries in maintenance databases.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Eclat stores, for each item,…
  2. 2. The support of an itemset is…
  3. 3. After building the lists, Eclat rescans the transactions…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

Tid-lists and diffsets by hand

Vertical layout. Number the five classic baskets 0–4: (bread, milk), (bread, diapers, beer, eggs), (milk, diapers, beer, cola), (bread, milk, diapers, beer), (bread, milk, diapers, cola). Then:

  • t(beer) = 1, 2, 3;
  • t(diapers) = 1, 2, 3, 4;
  • t(milk) = 0, 2, 3, 4.

Intersection. t(beer, diapers) = t(beer) ∩ t(diapers) = 1, 2, 3, so support = 3 (0.6). t(beer, diapers, milk) = 2, 3, so its count is 2.

Equivalence classes and depth-first search. Order the frequent items. The class of prefix P holds the frequent items that can extend P. Item k in a class is joined only with the items after it, so each itemset is generated exactly once: in a class (a, b, c, d), b is joined with c and d only.

Diffsets (dEclat). For prefix P and extension X, store d(PX) = t(P) − t(PX), the transactions lost by adding X. Then support(PX) = support(P) − |d(PX)|. For deeper levels:

  • d(PXY) = d(PY) − d(PX);
  • support(PXY) = support(PX) − |d(PXY)|.

With t(P) = 0…4, t(PX) = 0, 2, 3: d(PX) = 1, 4 and support(PX) = 5 − 2 = 3.

The steps in plain English:

  1. Scan once to build each frequent item’s tid-list.
  2. Sort the items, by increasing support for efficiency, and start the depth-first search with the class of single items.
  3. For each item in a class, intersect its tid-list with each later sibling’s, keeping the frequent results as the next class, and recurse.
  4. On dense data, switch to diffsets after the first level (dEclat); with bitmaps, intersections become word-wise ANDs.
📝 Quick check (Level 1)
0/3 answered
  1. 1. support(PX) in terms of the diffset is…
  2. 2. Within a class, item k is joined with…
  3. 3. Eclat explores the search space…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.

Why intersections, and when diffsets win

Correctness. A transaction contains X ∪ Y exactly when it contains X and contains Y, so t(X ∪ Y) = t(X) ∩ t(Y), and support follows from the intersection’s size. Depth-first search over classes with “join only later siblings” enumerates every frequent itemset once. Downward closure prunes, because an infrequent tid-list is never extended.

Cost. Intersecting sorted lists of lengths a and b costs O(a + b); with bitmaps it costs n/64 word operations. Depth-first search keeps memory for one path of classes at a time.

Diffsets. In dense data, most transactions containing P also contain X, so t(PX) is almost as long as t(P), while d(PX) is short. Zaki and Gouda (2003) showed that diffsets cut memory by orders of magnitude on dense benchmark data. On sparse data the reverse holds: t(PX) is short and d(PX) is long.

Exercise 1 (500 baskets over 20 items, minimum count 25):

  • Eclat found 50 frequent itemsets, identical to level-wise counting;
  • it made one scan to build the tid-lists and 12 213 element comparisons in its intersections.
import numpy as np
# bitmap Eclat: one boolean (or packed-bit) row per item
B = onehot.values.T                            # items × transactions
support = (B[i] & B[j]).sum()                  # intersection by AND
🐍 Exercise 1: Eclat from scratch
Build the vertical tid-lists, run depth-first Eclat over prefix equivalence classes with tidset intersections, and verify the frequent itemsets against level-wise counting.
📝 Quick check (Level 2)
0/3 answered
  1. 1. t(X ∪ Y) equals…
  2. 2. Diffsets are smaller than tidsets mainly on…
  3. 3. With bitmaps, an intersection costs about…

Level 3: Advanced

★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.

Theory

Equivalence classes. Itemsets sharing a (k − 1)-prefix form a class whose k-itemsets can be joined only with each other. Classes are independent sub-problems, so Eclat parallelises naturally by assigning classes to workers (Zaki, 2000).

Diffset recurrence. Since t(PXY) = t(PX) ∩ t(PY), we have d(PXY) = t(PX) − t(PXY) = t(PX) − t(PY). And t(PX) − t(PY) = (t(P) − t(PY)) − (t(P) − t(PX)), because both t(PX) and t(PY) lie inside t(P). So d(PXY) = d(PY) − d(PX). Support then follows by subtraction, never touching full tid-lists below the first level.

Comparisons.

  • Apriori is horizontal and breadth-first, with candidates.
  • FP-Growth is horizontal, compressed in a tree, and depth-first without candidates.
  • Eclat is vertical and depth-first.

Benchmarks (the FIMI workshops, 2003–2004) found no universal winner: performance depends on density, support and implementation quality. Bitmap-based vertical miners and FP-Growth were often the fastest.

Interview questions.

  • How would you speed up support counting for millions of transactions? Use a vertical bitmap per item, ANDed with SIMD; use diffsets on dense data; and partition classes across cores.
  • What is the main drawback of Eclat? Long tid-lists on dense data or with many transactions consume memory. Use diffsets, compressed bitmaps (Roaring) or a horizontal method.
📝 Quick check (Level 3)
0/3 answered
  1. 1. d(PXY) equals…
  2. 2. Eclat parallelises naturally because…
  3. 3. The FIMI benchmarks found…

Level 4: Expert

★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.

Tidsets or diffsets?

History.

  • M. Zaki, S. Parthasarathy, M. Ogihara and W. Li (1997) introduced Eclat and its parallel variants.
  • M. Zaki (2000) analysed scalability.
  • M. Zaki and K. Gouda (2003) introduced diffsets (dEclat).
  • B. Goethals and M. Zaki (2003–2004) organised the FIMI implementation workshops.

Exercise 2. The sparse and dense datasets from the FP-Growth page, with the same frequent itemsets (99 and 316). The table gives the total set elements stored while mining.

data item occurrences tidsets diffsets
sparse 3447 4054 5647
dense 5438 63 525 21 835
  • On dense data, diffsets needed 2.9 times less storage (21 835 against 63 525 elements). Most transactions containing a prefix also contained each extension, so little was lost per step.
  • On sparse data, tidsets were smaller (4054 against 5647): extending a prefix loses most of its transactions, so diffsets are long while tidsets are short.
  • On the dense data, plain Eclat stored more than 11 times as many elements as there are item occurrences, because tid-lists of many overlapping itemsets are kept. Choosing the representation by density, as hybrid miners do, matters more than the search order.
🐍 Exercise 2 (research): tidsets versus diffsets
Implement Eclat with tidsets and dEclat with diffsets, and compare the total number of set elements each stores on sparse and dense synthetic baskets.

Eclat in AI, robotics and aerospace

  • Fast co-occurrence queries: bitmap indexes over flights or work orders answer “how often do codes A, B and C occur together” in microseconds.
  • Frequent pattern mining on GPUs: vertical bitmaps map well onto GPU AND and popcount instructions.
  • Log analytics: inverted lists of event types per session support both search and pattern mining.

References

  1. M. J. Zaki (2000). “Scalable algorithms for association mining.” IEEE Transactions on Knowledge and Data Engineering 12(3).
  2. M. J. Zaki, K. Gouda (2003). “Fast vertical mining using diffsets.” Proc. ACM KDD.
  3. M. J. Zaki, S. Parthasarathy, M. Ogihara, W. Li (1997). “New algorithms for fast discovery of association rules.” Proc. ACM KDD.
  4. B. Goethals, M. J. Zaki (2004). “Advances in frequent itemset mining implementations: report on FIMI’03.” ACM SIGKDD Explorations 6(1).