Professional Documents
Culture Documents
ESE Handouts 3 Apriori Algo (Fall 2016)
ESE Handouts 3 Apriori Algo (Fall 2016)
Customer1
Customer3
Customer2
1
ASSOCIATION RULE MINING
2
ASSOCIATION RULE MINING
Basic Concepts
Find all rules that correlate the presence of one set of items
with that of another set of items
3
ASSOCIATION RULE MINING
Useful:
"On Thursdays, grocery store consumers often
purchase diapers and beer together.“
Trivial:
"Customers who purchase maintenance agreements
are very likely to purchase large appliances."
Unexplicable/unexpected:
"When a new hardaware store opens, one of the most
sold items is toilet rings."
5
ASSOCIATION RULE MINING
6
ASSOCIATION RULE MINING
• Minimum confidence :
– High few rules, but all "almost logically true"
– Low many rules, many of them very "uncertain"
7
ASSOCIATION RULE MINING
8
ASSOCIATION RULE MINING
9
ASSOCIATION RULE MINING
10
ASSOCIATION RULE MINING
Apriori Algorithm
11
ASSOCIATION RULE MINING
12
ASSOCIATION RULE MINING
123 124 125 134 135 145 234 235 245 345
12 13 14 15 23 24 25 34 35 45
1 2 3 4 5
13
ASSOCIATION RULE MINING
14
ASSOCIATION RULE MINING
15
ASSOCIATION RULE MINING
123 124 125 134 135 145 234 235 245 345
12 13 14 15 23 24 25 34 35 45
1 2 3 4 5
16
ASSOCIATION RULE MINING
Self-joining: L3*L3
abcd from abc and abd
acde from acd and ace
Pruning:
acde is removed because ade is not in L3
C4={abcd}
17
ASSOCIATION RULE MINING
Apriori Algorithm
Database D itemset sup.
L1 itemset sup.
TID Items C1 {1} 2 {1} 2
100 134 {2} 3 {2} 3
200 235 Scan D {3} 3 {3} 3
300 1235 {4} 1 {5} 3
400 25 {5} 3
C2 itemset sup C2 itemset
L2 itemset sup {1 2} 1 Scan D {1 2}
{1 3} 2 {1 3} 2 {1 3}
{2 3} 2 {1 5} 1 {1 5}
{2 3} 2 {2 3}
{2 5} 3
{2 5} 3 {2 5}
{3 5} 2
{3 5} 2 {3 5}
C3 itemset Scan D L3 itemset sup
{2 3 5} {2 3 5} 2
18
ASSOCIATION RULE MINING
Reference
19