title: R aRules: Find closed association rules
body: <p>In the <a href="https://cran.r-project.org/web/packages/arules/index.html" rel="nofollow">aRules</a> package in R, how could I go about efficiently finding <strong>closed</strong> association rules? i.e. Rules with a closed LHS itemset</p>
  
  <p>An itemset is closed iff adding any item reduces support.</p>
  
  <p>The package provides the following mining options:</p>
  
  <blockquote>
    <p>target: a character string indicating the type of association mined.
    One of</p>
    
    <ul>
    <li>"frequent itemsets"</li>
    <li>"maximally frequent itemsets"</li>
    <li>"closed frequent itemsets"</li>
    <li>"rules" (only available for Apriori)</li>
    <li>"hyperedgesets" (only available for Apriori; see references for the    definition of association •  hyperedgesets)</li>
    </ul>
  </blockquote>
  
  <p>There doesn't seem to be a "closed rules" option. There are two obvious work-arounds:</p>
  
  <ol>
  <li><p>Mine rules and apply filter for closed itemsets</p>
  
  <pre><code>rules = apriori(data, parameter=list(target="rules")))
  rules &lt;- rules[is.closed(generatingItemsets(rules))]
  </code></pre></li>
  </ol>
  
  <p>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.</p>
  
  <ol start="2">
  <li>Mine closed frequent itemsets and apply filter for associations (confidence, lift etc)</li>
  </ol>
  
  <p>Not yet implemented, but it seems like a round about way of achieving something much simpler.</p>
  
  <p>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. <a href="http://www.philippe-fournier-viger.com/spmf/index.php?link=algorithms.php" rel="nofollow">The SPMF library</a> seems to have support for it, wondering if anyone has experience using it</p>