数据挖掘第二次作业 1. (a) Find all frequent itemsets using Apriori and FP-growth, respectively, by treating each transaction ID as a market basket. Compare the efficiency of the two mining processes. Apriori:最小支持度计数值10*50%=5 C1= L1= C2= L2= C3= 没有频繁3 项级 L={{a}{b}{c}{d}{e}{ae}{be}{de}} FP-growth 数据库的第一次扫描同Apriori,导出频繁1 项集的集合和支持度计数(最小支持度计数为5)。频繁1 项集按支持度递减序排序,结果集记为:L={{e:8},{a:7},{b:6}, {d:6},{c:5}}。 a 7 b 6 c 5 d 6 e 8 ab 4 ad 4 ac 3 ae 6 bd 2 bc 2 be 5 cd 2 de 5 ae 6 be 5 de 5 a 7 b 6 d 6 c 5 e 8 abe 3 ade 4 构造FP 树如下: 从底层开始构建条件模式基挖掘条件FP树从而找出频繁项集 项 条件模式基 条件FP树 产生的频繁模式 c {{ead:1}{eab:1}{eb:1}{d:1}{ab:1}} <> {} d {{ea:3}{eab:1}{eb:2}}
{ed:5}{ad:4}{ead:4} b {{ea:3}{e:2}{a:1}} , {eb:5}{ab:4} a {{e:6}} {ea:6} L={{a}{b}{c}{d}{e}{ae}{be}{de}}; Apriori 与FP-growth 的效率比较: Apriori 挖掘全部频繁项集时需要产生候选项集,而且需要多次重复地扫描数据库,增加I/O开销。而FP-growth是不用产生候选的方法,它构造一个高度压缩的数据结构—FP树来压缩原先的事务数据库,并且整个FP-growth过程只需2次来扫描数据库,还有就是FP-growth的不是使用Apriori方法的产生-测试策略,而聚焦于频繁模式段增长,避免了高代价的候选产生,此外,它的基本操作是计数频繁项集和建立条件FP树,没有模式搜索和匹配过程,因而获得了更好的效率。但是FP-growth也存在一些缺点,额外建立 FP树是要耗内存的,而且经常包含一些冗余信息。 (b) Use the results in part (a) to compute the confi dence for the association rules {a, d}{e} and {e}{a, d}. Is confi dence a symmetric measure? {a, d}=> {e}, confidence=4/4=100% {e}=> {a, d}, confidence=4/8=50% 两个关联规则的置信度不相等,因此置信度不是对称规则。 e 8 a 7 b 6 d 6 c 5 (c) List all of the strong association rules (with support s and confidence c) matching the foll...