我们如何找到与时间顺序的事务匹配的规则(通过cSPADE函数挖掘)。
例如,使用arulessequence包中的Zaki数据:
> as(zaki,"data.frame")
items sequenceID eventID SIZE
1 {C,D} 1 10 2
2 {A,B,C} 1 15 3
3 {A,B,F} 1 20 3
4 {A,C,D,F} 1 25 4
5 {A,B,F} 2 15 3
6 {E} 2 20 1
7 {A,B,F} 3 10 3
8 {D,G,H} 4 10 3
9 {B,F} 4 20 2
10 {A,G,H} 4 25 3
规则通过以下方式开采:
> s4 <- cspade(t, parameter = list(support = 0.4))
> r2 <- ruleInduction(s4, confidence = 0.5, control = list(verbose = TRUE))
> as(r2,"data.frame")
rule support confidence lift
1 <{D}> => <{F}> 0.5 1.0 1.0
2 <{D}> => <{B,F}> 0.5 1.0 1.0
3 <{D}> => <{B}> 0.5 1.0 1.0
4 <{B}> => <{A}> 0.5 0.5 0.5
5 <{D}> => <{A}> 0.5 1.0 1.0
6 <{F}> => <{A}> 0.5 0.5 0.5
7 <{D},{F}> => <{A}> 0.5 1.0 1.0
8 <{B,F}> => <{A}> 0.5 0.5 0.5
9 <{D},{B,F}> => <{A}> 0.5 1.0 1.0
10 <{D},{B}> => <{A}> 0.5 1.0 1.0
让我们说一个新的交易顺序如下:
items sequenceID eventID SIZE
1 {A,C} 5 10 1
2 {B,F,E} 5 15 3
3 {B,G} 5 20 2
4 {A,C,H} 5 25 3
目标是找到满足r2的lhs的规则。目标结果(手工起草)是:
rule support confidence lift
4 <{B}> => <{A}> 0.5 0.5 0.5
6 <{F}> => <{A}> 0.5 0.5 0.5
8 <{B,F}> => <{A}> 0.5 0.5 0.5
我希望我已经正确解释了这个问题,thnx!