Learn R Programming

arules (version 1.7.15)

arules-package: Infrastructure for representing transaction data, mining frequent itemsets and association rules, and evaluating the resulting patterns. The package includes efficient C implementations of the Apriori and Eclat algorithms.

Description

logo

Provides the infrastructure for representing, manipulating and analyzing transaction data and patterns (frequent itemsets and association rules). Also provides C implementations of the association mining algorithms Apriori and Eclat. Hahsler, Gruen and Hornik (2005) tools:::Rd_expr_doi("10.18637/jss.v014.i15").

Arguments

Typical workflow

  1. Create a transactions object with transactions() or import basket or single-format data with read.transactions(). Numeric variables should first be converted to categories with discretize() or discretizeDF().

  2. Inspect the data with summary(), inspect(), itemFrequency(), or itemFrequencyPlot().

  3. Mine association rules with apriori() or frequent itemsets with eclat().

  4. Rank and filter patterns with sort(), subset(), and interestMeasure(). Use is.redundant(), is.closed(), or is.maximal() for common postprocessing tasks.

  5. Convert results with DATAFRAME() or LIST(), or visualize them with the suggested package arulesViz.

Choosing a mining function

  • apriori() mines rules or itemsets and offers detailed control over rule appearance.

  • eclat() is designed for mining frequent, closed, or maximal itemsets.

  • ruleInduction() creates rules from an existing collection of itemsets.

  • fim4r() provides access to additional mining algorithms when the optional fim4r package is installed.

Core classes

transactions stores sparse binary transaction data. Mining functions return itemsets or rules, both derived from associations. Item coding must be compatible when objects are compared or combined; see itemCoding.

Author

Maintainer: Michael Hahsler mhahsler@lyle.smu.edu (ORCID) [copyright holder]

Authors:

  • Michael Hahsler mhahsler@lyle.smu.edu (ORCID) [copyright holder]

  • Christian Buchta [copyright holder]

  • Bettina Gruen [copyright holder]

  • Kurt Hornik (ORCID) [copyright holder]

Other contributors:

  • Christian Borgelt [contributor, copyright holder]

  • Ian Johnson [contributor]

  • Makhlouf Ledmi [contributor]

See Also

arulesViz for visualization and the package vignettes for extended examples.