ruleInduction {arules}R Documentation

Association Rule Induction from Itemsets

Description

Provides the generic function ruleInduction() and the method to induce all association rules which can be generated by the given set of itemsets from a transactions dataset.

Usage

ruleInduction(x, ...)

## S4 method for signature 'itemsets'
ruleInduction(
  x,
  transactions = NULL,
  confidence = 0.8,
  method = c("ptree", "apriori"),
  reduce = FALSE,
  verbose = FALSE,
  ...
)

Arguments

x

the set of itemsets from which rules will be induced.

...

further arguments.

transactions

the transactions used to mine the itemsets. Can be omitted for method "ptree", if x contains a (complete set) of frequent itemsets together with their support counts.

confidence

a numeric value between 0 and 1 giving the minimum confidence threshold for the rules.

method

"ptree" or "apriori"

reduce

remove unused items to speed up the counting process?

verbose

report progress?

Details

All rules that can be created using the supplied itemsets and that surpass the specified minimum confidence threshold are returned. ruleInduction() can be used to produce closed association rules defined by Pei et al. (2000) as rules ⁠X => Y⁠ where both X and Y are closed frequent itemsets. See the code example in the Example section.

Rule induction implements several induction methods. The default method is "ptree"

Value

An object of class rules.

Author(s)

Christian Buchta and Michael Hahsler

References

Michael Hahsler, Christian Buchta, and Kurt Hornik. Selective association rule generation. Computational Statistics, 23(2):303-315, April 2008.

Jian Pei, Jiawei Han, Runying Mao. CLOSET: An Efficient Algorithm for Mining Frequent Closed Itemsets. ACM SIGMOD Workshop on Research Issues in Data Mining and Knowledge Discovery (DMKD 2000).

See Also

Other mining algorithms: APappearance-class, AScontrol-classes, ASparameter-classes, apriori(), eclat(), fim4r(), weclat()

Examples

data("Adult")

## find all closed frequent itemsets
closed_is <- apriori(Adult, target = "closed frequent itemsets", support = 0.4)
closed_is

## use rule induction to produce all closed association rules
closed_rules <- ruleInduction(closed_is, transactions = Adult, verbose = TRUE)

## inspect the resulting closed rules
summary(closed_rules)
inspect(head(closed_rules, by = "lift"))

## get rules from frequent itemsets. Here, transactions does not need to be
## specified for rule induction.
frequent_is  <- eclat(Adult, support = 0.4)
assoc_rules <- ruleInduction(frequent_is)
assoc_rules
inspect(head(assoc_rules))

## for itemsets that are not a complete set of frequent itemsets,
## transactions need to be specified.
some_is <- sample(frequent_is, 10)
some_rules <- ruleInduction(some_is, transactions = Adult)
some_rules

[Package arules version 1.7-7 Index]