1
$\begingroup$

I tried using the apriori algorithm in the arules library for association rules mining in R. There's two thing I'd like to ask:

  1. Why are the lhs and rhs of the rules in intervals? For example U get something like this lhs : Variable1[0,4] - rhs : Variable2[0,3]

  2. How can I subset the rules extracted for a certain variable? Say I want rules for Variable 1. How can I subset the result to get rules containing that variable only?

$\endgroup$

2 Answers 2

1
$\begingroup$
  1. I do not recall lhs or rhs having intervals. Can you share an example?
  2. You can use the "appearance" parameter when calling apriori. You can find an example in the documentation of APappearance-class of arules or at http://r-statistics.co/Association-Mining-With-R.html under section "How to Find Rules Related To Given Item/s"
$\endgroup$
1
$\begingroup$

Ok so, just in case more people have come across the same problem, I'll post the answer to my own question. And the answer is, I was a goofball. Some attributes were not factorized like they should have been and I got the result I described. So apparently, arules did some extra binning by itself.

Also, the link by Dimitrios was fairly helpful and thus, gets the nod for accepted. I can't bring myself to accepting my own answer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.