AssociationRules: Calculate Association rules with minimal support and...

Description Usage Arguments Value Examples

View source: R/AssociationRules.R

Description

AssocationRules() computes association rules with minimal support and confidence based on a set of transactions. Additionally, one can precalculate the frequent item-sets externally and provide them via the FrequentItems parameter. Per default only consequent of length 1 are calculated. This can be changed with the parameter maxConsquentLength.

Usage

1
2
AssociationRules(Itemsets, minsupport, minconfidence = 0, FrequentItems,
  maxConsequentLength = 1)

Arguments

Itemsets

Object of class TAMatrix, matrix, sparse matrix, data.frame or transactions that contain the trainsaction for which the rules should be calculated.

minsupport

Minimal support level the rules should have.

minconfidence

Minimal confidence level the rules should have.

FrequentItems

Precalculated frequent itemsets as an sparse matrix, matrix, data.frame, FIMatrix or itemsets class object.

maxConsequentLength

Maximal length of the consequents for the generated rules.

Value

Object of class Rules containing the calculated rules as well as quality measures.

Examples

1
2
3
4
5
6
7
8
9
# Calculate the Rules with minimal support 0.03 
# and confidence 0.4 based on the dataset Groceries
Groceries_Rules <- AssociationRules(Itemsets = Groceries, minsupport = 0.03, minconfidence = 0.4)

# print the rules
print(Groceries_Rules)

# plot the rules
plot(Groceries_Rules)

TimToebrock/Rpriori documentation built on Oct. 18, 2020, 9:41 p.m.