冗余规则
使用 apriori() 算法提取出规则后,工作还没有结束。您需要在这些规则中找出冗余规则,并只保留非冗余规则。鉴于使用 apriori() 函数可能会提取出大量规则,这一步至关重要。
本练习是课程的一部分
R 中的购物篮分析
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Apply the apriori function to the Online retail dataset
rules = apriori(Online_trx,
___ = list(supp = ___, conf = ___,
minlen = 2))
# Inspect the first 5 rules
___(___(rules))