R中Apriori函数的问题

时间:2017-09-10 12:23:00

标签: r apriori mining

我是数据挖掘的新手。我有一个任务,在R中使用Apriori函数(包:arules)来打印所有关联规则。但问题是它只在RHS上打印一个项目。以下是我使用的程序:

a_list <- list(
c("I1","I2","I5"),
c("I2","I4"),
c("I2","I3"),
c("I1","I2","I4"),
c("I1","I3"),
c("I2","I3"),
c("I1","I3"),
c("I1","I2","I3","I5"),
c("I1","I2","I3")
)
names(a_list) <- paste("T",c(1:9), "00", sep = "")
table5_1 <- as(a_list, "transactions")
rules <- apriori(table5_1, parameter = list(supp = 0.21, conf = 0.7,
target = "rules"))
inspect(rules)

输出:

     lhs        rhs  support   confidence lift     count
 [1] {}      => {I2} 0.7777778 0.7777778  1.000000 7    
 [2] {I4}    => {I2} 0.2222222 1.0000000  1.285714 2    
 [3] {I5}    => {I1} 0.2222222 1.0000000  1.500000 2    
 [4] {I5}    => {I2} 0.2222222 1.0000000  1.285714 2    
 [5] {I1,I5} => {I2} 0.2222222 1.0000000  1.285714 2    
 [6] {I2,I5} => {I1} 0.2222222 1.0000000  1.500000 2 

任何人都可以告诉我可以通过哪种方法获得生成的所有关联规则?我和minlen和maxlen一起尝试过,但对我来说没什么用。 提前致谢

1 个答案:

答案 0 :(得分:1)

引用文档?apriori

  

Apriori只在RHS(结果)中创建一个项目的规则!