Description Usage Arguments Value Examples
View source: R/AssociationRules.R
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.
1 2 | AssociationRules(Itemsets, minsupport, minconfidence = 0, FrequentItems,
maxConsequentLength = 1)
|
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. |
Object of class Rules containing the calculated rules as well as quality measures.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.