Association Rules--Apriori Algorithm

来源:互联网 发布:台湾人逛淘宝吗 编辑:程序博客网 时间:2024/05/01 21:40

1.Association Rules Outline

1.1 Goal: Provide an overview of basic Association Rule mining techniques

Association Rules Problem Overview

Large itemsets

Association Rules Algorithms

Apriori

Sampling

Partitioning

Parallel Algorithms

Comparing Techniques

Incremental Algorithms

Advanced AR Techniques

1.2 Items frequently purchased together:

      Bread=>PeanutButter

1.3 Uses:

Placement

Advertising

Sales

Coupons

1.4 Objective: increase sales and reduce costs

1.5 Association Rule Definitions

Set of items: I={I1,I2,…,Im}

Transactions: D={t1,t2, …, tn}, tjÍ I

Itemset: {Ii1,Ii2, …, Iik} Í I

Support of an itemset: Percentage of transactions whichcontain that itemset.

Large(Frequent) itemset:Itemset whose number of occurrences is above athreshold.

1.6 AssociationRules Example 

I = { Beer, Bread, Jelly, Milk,PeanutButter}; Support of {Bread,PeanutButter} is 60%

       
1.7 AssociationRule Definitions

Association Rule(AR):implication X => Y where X,Y ∈ I and X ∩ Y = ∅;

Support of AR (s) X =>Y: Percentage of transactions that contain X∪Y;

Confidence of AR(a) X=> Y: Ratio of number of transactions that contain X∪Y to the number that contain X;

1.8 AssociationRules Ex (cont’d)


Algorithmto Generate ARs

       

2.1 Large Itemset Property:

Any subset of a large itemset is large.

Contra positive:

If an itemset is not large, none of its supersets are large.

      

2.2 Apriori Ex (cont’d)
      

2.3 Apriori Algorithm

C1 = Itemsets of size one in I;

Determine all large itemsets of size 1, L1;

i = 1;

Repeat

   i = i + 1;

   Ci = Apriori-Gen(Li-1);

   Count Ci to determine Li;

until no more large itemsets found;

2.4 Apriori-Gen

Generate candidates of size i+1from large itemsets of size i.

Approach used: join large itemsets of size i if they agree on i-1

May also prune candidates who havesubsets that are not large.

2.5 Apriori-Gen Example
      

2.6 Apriori-Gen Example (cont’d)

      


2.7 AprioriAdv/Disadv

Advantages:

Uses large itemset property.

Easily parallelized

Easy to implement.

Disadvantages:

Assumes transaction database ismemory resident.

Requires up to m database scans.


0 0
原创粉丝点击