support(x, transactions, ...)
## S3 method for class 'itemMatrix':
support(x, transactions,
type= c("relative", "absolute"), control = NULL)
## S3 method for class 'associations':
support(x, transactions,
type= c("relative", "absolute"), control = NULL)
"relative"
support or "absolute"
support (counts) are returned for the itemsets in x
.
(default: "relative"
)method
indicating the method ("tidlists"
or "ptree"
),
and the logical arguments
reduce
and
verbose
to indicate if unused items are removed and if x
containing
the support values for the sets in x
.method = "ptree"
is used,
the counters for the itemsets are
organized in a prefix tree. The transactions are sequentially processed
and the corresponding counters in the prefix tree are incremented
(see Hahsler et al, 2008). This method is used by default since it is
typically significantly faster than tid list intersection.
If in control method = "tidlists"
is used,
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.
If in control reduce = TRUE
is used, unused items are removed from
the data before creating rules. This might be slower for large transaction
data sets.itemMatrix-class
,
associations-class
,
transactions-class
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