Frequent Pattern 交易資料庫中頻繁的被一起購買的產品 可以做為推薦產品、銷售決策的依據 兩大演算法 Apriori FP-Tree
Apriori Transaction IDItems Bought Large 1 itemsets Candidate 1Count scan count
Apriori C2C L C2C2 Count scan count generate C 2 TIDItems Bought L
Apriori C3C3 235 L C3C3 Count 2352 scan count generate C 3 TIDItems Bought L All frequent itemsets
Apriori 缺點 效率不佳 IO 時間過長 Candidate 過多
FP-Tree min_sup= 50% min_sup_count= 3 TIDItems Bought 100f,a,c,d,g,i,m,p 200a,b,c,f,l,m,o 300b,f,h,j,o 400b,c,k,s,p 500a,f,c,e,l,p,m,n Itemssupport abcdefghijklmnopabcdefghijklmnop Itemssupport fcabmpfcabmp
FP-Tree Itemssupport fcabmpfcabmp TIDItems BoughtFrequent Items 100f,a,c,d,g,i,m,pf,c,a,m,p 200a,b,c,f,l,m,of,c,a,b,m 300b,f,h,j,of,b 400b,c,k,s,pc,b,p 500a,f,c,e,l,p,m,nf,c,a,m,p
itemhead of node-links f c a b m p Root (order) Frequent Items f,c,a,m,p f,c,a,b,m f,b c,b,p f,c,a,m,p f:1 fc c:1 a:1 m:1 p:1 f f:2 c c:2 a a:2 b b:1 m:1 m
itemhead of node-links f c a b m p Root (order) Frequent Items f,c,a,m,p f,c,a,b,m f,b c,b,p f,c,a,m,p f:4 c:3 a:3 m:2 p:2 b:1 m:1 b:1 c:1 b:1 p:1
itemhead of node-links f c a b m p Root f:4 c:3 a:3 m:2 p:2 b:1 m:1 b:1 c:1 b:1 p:1 Prefix {m}-Conditional Pattern Base m( acf:2 ) (bacf:1 )
Frequent items | p f:3 c:3 a:3 Root f:3 itemhead of node-links f c a Prefix {m}-Conditional Pattern Base m( acf:2 ) (bacf:1 ) c:3 a:3 Frequent Item Sets fm:3, cm:3, am:3, fcm:3, fam:3, cam:3, fcam:3
itemhead of node-links f c a b m p Root f:4 c:3 a:3 m:2 p:2 b:1 m:1 b:1 c:1 b:1 p:1 Frequent Item Sets cp:3, am:3, cam:3, fcam:3, fcam:3, fam:3, cm:3, fcm:3, fm:3, ca:3, fca:3, fa:3, fc:3