weclat | R Documentation |
Find frequent itemsets with the Eclat algorithm. This implementation uses optimized transaction ID list joins and transaction weights to implement weighted association rule mining (WARM).
weclat(data, parameter = NULL, control = NULL)
data |
an object that can be coerced into an object of class transactions. |
parameter |
an object of class ASparameter (default
values: |
control |
an object of class AScontrol (default values:
|
Transaction weights are stored in the transactions as a column called
weight
in transactionInfo.
The weighted support of an itemset is the sum of the weights of the
transactions that contain the itemset. An itemset is frequent if its
weighted support is equal or greater than the threshold specified by
support
(assuming that the weights sum to one).
Note that Eclat only mines (weighted) frequent itemsets. Weighted
association rules can be created using ruleInduction()
.
Returns an object of class itemsets. Note that
weighted support is returned in quality as column support
.
The C code can be interrupted by CTRL-C
. This is convenient but comes
at the price that the code cannot clean up its internal memory.
Christian Buchta
G.D. Ramkumar, S. Ranka, and S. Tsur (1998). Weighted Association Rules: Model and Algorithm, Proceedings of ACM SIGKDD.
Other mining algorithms:
APappearance-class
,
AScontrol-classes
,
ASparameter-classes
,
apriori()
,
eclat()
,
fim4r()
,
ruleInduction()
Other weighted association mining functions:
SunBai
,
hits()
## Example 1: SunBai data
data(SunBai)
SunBai
## weights are stored in transactionInfo
transactionInfo(SunBai)
## mine weighted support itemsets using transaction support in SunBai
s <- weclat(SunBai, parameter = list(support = 0.3),
control = list(verbose = TRUE))
inspect(sort(s))
## create rules using weighted support (satisfying a minimum
## weighted confidence of 90%).
r <- ruleInduction(s, confidence = .9)
inspect(r)
## Example 2: Find association rules in weighted data
trans <- list(
c("A", "B", "C", "D", "E"),
c("C", "F", "G"),
c("A", "B"),
c("A"),
c("C", "F", "G", "H"),
c("A", "G", "H")
)
weight <- c(5, 10, 6, 7, 5, 1)
## convert list to transactions
trans <- transactions(trans)
## add weight information
transactionInfo(trans) <- data.frame(weight = weight)
inspect(trans)
## mine weighed support itemsets
s <- weclat(trans, parameter = list(support = 0.3),
control = list(verbose = TRUE))
inspect(sort(s))
## create association rules
r <- ruleInduction(s, confidence = .5)
inspect(r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.