Learn R Programming

arules (version 0.2-6)

support: Support Counting for Itemsets

Description

Provides the generic function and the needed S4 method to count support for given itemsets (and other types of associations) in a given transaction database.

Usage

support(x, transactions, ...)
## S3 method for class 'itemMatrix':
support(x, transactions, type= c("relative", "absolute"))
## S3 method for class 'associations':
support(x, transactions, type= c("relative", "absolute"))

Arguments

x
the set of itemsets for which support should be counted.
...
further arguments are passed on.
transactions
the transaction data set used for mining.
type
a character string specifying if "relative" support or "absolute" support (counts) are returned for the itemsets in x. (default: "relative")

Value

  • A numeric vector of the same length as x containing the support values for the sets in x.

Details

Normally, itemset support is counted during mining the database with a set minimum support. However, if only the support information for a single or a few itemsets is needed, one might not want to mine the database for all frequent itemsets. Support is counted using transaction ID list intersection which is used by several fast mining algorithms (e.g., by Eclat). However, Support is determined for each itemset individually which is slow for a large number of long itemsets in dense data. In this case mining the whole database might be preferable.

See Also

itemMatrix-class, associations-class, transactions-class

Examples

Run this code
data("Income")

### find and some frequent itemsets
itemsets <- eclat(Income)[1:5]

### inspect the support returned by eclat
inspect(itemsets)

### count support in the database
support(items(itemsets), Income)

Run the code above in your browser using DataLab