【发布时间】:2018-11-20 17:06:06
【问题描述】:
我有一个如下所示的数据框:
Cus T C B
1: C1 0 1 1
2: C2 0 1 0
3: C3 0 1 0
4: C4 0 1 0
5: C5 0 1 0
6: C6 0 1 1
当我在这个确切的数据帧上使用 apriori 时,它会产生类似的结果
lhs rhs support confidence lift count
[1] {} => {c=0} 0.8360112 0.8360112 1 616223
[2] {} => {t=0} 0.8765905 0.8765905 1 646134
[3] {} => {a=0} 0.8953804 0.8953804 1 659984
[4] {} => {b=0} 0.9103811 0.9103811 1 671041
[5] {} => {d=0} 0.9441812 0.9441812 1 695955
我已经尝试将这个dataframe转换成事务bb,然后使用排除特征为0的结果
excluded <- grep("=0", itemLabels(bb), value = TRUE)
rules = apriori(bb, appearance = list(none = excluded))
只留下 0 条规则的输出。
如何在 apriori 的输出中得到一些仅特征值为 1 的有用结果?
【问题讨论】:
标签: r associations rules apriori