1
votes

The aprori algorithm produces a large number of rules, is there any way query/filter the resulting ruleset, for example looking for rules with specific items appearing in the antecedent, or rules with specific size?

1

1 Answers

0
votes

I can help you only partially.

When using apriori algorithm in R, you can add an option to specify the size of the output rules. The attribute to do that is maxlen.

In this case, for example, I want to obtain only rules with size 2.

rules <- apriori(orders, parameter = list(supp = 0.01, conf = 0.5, maxlen=2))

By this attribute we will obtain rules such as: [item1] -> [item2]

Daniele