Description
The following R Snippet in AssociationRulesSuite is wrong:
/* Verify results using the `R` code:
transactions = as(sapply(
list("r z h k p",
"z y x w v u t s",
"s x o n r",
"x z y m t s q e",
"z",
"x z y r q t p"),
FUN=function strsplit(x," ",fixed=TRUE)),
"transactions")
ars = apriori(transactions,
parameter = list(support = 0.0, confidence = 0.5, target="rules", minlen=2))
arsDF = as(ars, "data.frame")
arsDF$support = arsDF$support * length(transactions)
names(arsDF)[names(arsDF) == "support"] = "freq"
> nrow(arsDF)
[1] 23
> sum(arsDF$confidence == 1)
[1] 23
*/
The real outputs are:
> nrow(arsDF)
[1] 441838
> sum(arsDF$confidence == 1)
[1] 441592
It is found that the parameters in apriori function were wrong.