0

Sorting the rules by lift or confidence is,

> rules.sorted <- sort(rules, by="lift")

But is it possible to sort by two or three columns (i.e., sort by lift,confidence and support(in this order))? In order(), we can sort based on any number of columns using comma. How to use that in sort() in arules package in R?

If I try this, I getting an following error,

 > rules.sorted <- sort(rules, by=c("lift","confidence","support"))
 > Error in .subset2(x, i, exact = exact) : recursive indexing failed at level 2

EDIT: You can find the process in following link http://www.rdatamining.com/examples/association-rules

Kavipriya
  • 441
  • 4
  • 17
  • 2
    can you include a small reproductible example? – Colonel Beauvel Aug 24 '15 at 07:37
  • @ColonelBeauvel I included the link, which contains all the steps. In that link, they sorted by lift alone, but i want to sort by lift, confidence and support values. – Kavipriya Aug 24 '15 at 08:28
  • Turn rules to data frame and then sort it as usual. rules.df <- as(rules, "data.frame") – gd047 Aug 24 '15 at 09:52
  • Just for the record: To quantify the information content of a rule, you can add a column with a rule evaluation measure (like the J-measure) and sort the rules according to that. – gd047 Aug 24 '15 at 10:02

0 Answers0