Issue with Apriori Function in R

187 views Asked by At

I am very new to Data Mining. I've got an assignment to print all the association rules against the confidence using Apriori function (Package : arules) in R. But the problem is that it prints only one item on RHS. Below is the program I used :

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)

Output :

     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 

Can anyone tell the method by which I can get all the association rules generated ? I tried it with minlen and maxlen but nothing worked for me. Thanks in advance

1

There are 1 answers

0
lukeA On

Citing the documentation ?apriori:

Apriori only creates rules with one item in the RHS (Consequent)!