通过多个字符串约束关联规则

时间:2016-12-08 20:16:13

标签: r rstudio apriori arules

我想知道是否有人知道如何通过指向包含约束的.csv来限制apriori(arules)中的左手和右手侧。

A very similar question was asked and answered in this post for anyone else struggling with something similar.

rules_sales <- apriori(sales, 
                       parameter=list(support=0.001, confidence=0.5, minlen=2, maxlen=2), 
                       appearance=list(lhs=c("HouseOwnerFlag=0", "HouseOwnerFlag=1"), 
                       rhs=paste0("Product=", unique(sales$Product)), default="none"))

但是我有一个相当大的限制列表要应用,并且我试图避免键入或复制并直接粘贴到R中。

感谢您的期待!

1 个答案:

答案 0 :(得分:0)

Verena Haunschmid在帖子的解决方案2:中提供了答案:

How to get items for both LHS and RHS for only specific columns in arules?