In the aRules package in R, how could I go about efficiently finding closed association rules? i.e. Rules with a closed LHS itemset
An itemset is closed iff adding any item reduces support.
The package provides the following mining options:
target: a character string indicating the type of association mined. One of
- "frequent itemsets"
- "maximally frequent itemsets"
- "closed frequent itemsets"
- "rules" (only available for Apriori)
- "hyperedgesets" (only available for Apriori; see references for the definition of association • hyperedgesets)
There doesn't seem to be a "closed rules" option. There are two obvious work-arounds:
Mine rules and apply filter for closed itemsets
rules = apriori(data, parameter=list(target="rules"))) rules <- rules[is.closed(generatingItemsets(rules))]
This can be quite slow. For eg on 5k transactions with 10k items, aPriori generated 8M rules in 10s. The closure filter took ~20 minutes resulting in ~3k closed rules.
- Mine closed frequent itemsets and apply filter for associations (confidence, lift etc)
Not yet implemented, but it seems like a round about way of achieving something much simpler.
If anyone is aware of other implementations (other R packages or even something outside R) which can do this, pointers would be very helpful. Eg. The SPMF library seems to have support for it, wondering if anyone has experience using it