Learn R Programming

arules (version 1.6-3)

is.redundant: Find Redundant Rules

Description

Provides the generic functions and the S4 method is.redundant to find redundant rules.

Usage

is.redundant(x, ...)
# S4 method for rules
is.redundant(x, measure = "confidence")

Arguments

x

a set of rules.

measure

measure used to check for redundancy.

...

additional arguments.

Value

returns a logical vector indicating which rules are redundant.

Details

A rule is redundant if a more general rules with the same or a higher confidence exists. That is, a more specific rule is redundant if it is only equally or even less predictive than a more general rule. A rule is more general if it has the same RHS but one or more items removed from the LHS. Formally, a rule \(X \Rightarrow Y\) is redundant if

$$\exists X' \subset X \quad conf(X' \Rightarrow Y) \ge conf(X \Rightarrow Y).$$

This is equivalent to a negative or zero improvement as defined by Bayardo et al. (2000). In this implementation other measures than confidence, e.g. improvement of lift, can be used as well.

References

Bayardo, R. , R. Agrawal, and D. Gunopulos (2000). Constraint-based rule mining in large, dense databases. Data Mining and Knowledge Discovery, 4(2/3):217--240.

See Also

interestMeasure

Examples

Run this code
# NOT RUN {
data("Income")

## mine some rules with the consequent "language in home=english"
rules <- apriori(Income, parameter = list(support = 0.5), 
  appearance = list(rhs = "language in home=english", default = "lhs"))

## for better comparison we sort the rules by confidence and add Bayado's improvement
rules <- sort(rules, by = "confidence")
quality(rules)$improvement <- interestMeasure(rules, measure = "improvement")
inspect(rules)
is.redundant(rules)

## redundant rules
inspect(rules[is.redundant(rules)])

## non-redundant rules
inspect(rules[!is.redundant(rules)])
# }

Run the code above in your browser using DataLab