Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
aprori 算法产生大量规则,有没有办法查询/过滤生成的规则集,例如查找具有特定项目出现在先行词中的规则,或具有特定大小的规则?
我只能帮助你一部分。
在 R 中使用先验算法时,您可以添加一个选项来指定输出规则的大小。执行此操作的属性是 maxlen。
例如,在这种情况下,我只想获取大小为 2 的规则。
规则 <- apriori(orders, parameter = list(supp = 0.01, conf = 0.5, maxlen=2))
通过这个属性,我们将获得如下规则:[item1] -> [item2]
丹尼尔