Learn R Programming

arules (version 1.0-12)

tidLists-class: Class ``tidLists'' --- Transaction ID Lists for Items/Itemsets

Description

Transaction ID lists contains a set of lists. Each list is associated with an item/itemset and stores the IDs of the transactions which support the item/itemset. tidLists uses the class ngCMatrix to efficiently store the transaction ID lists as a sparse matrix. Each column in the matrix represents one transaction ID list. tidLists can be used for different purposes. For some operations (e.g., support counting) it is efficient to coerce a transactions database into tidLists where each list contains the transaction IDs for an item (and the support is given by the length of the list). The implementation of the Eclat mining algorithm (which uses transaction ID list intersection) can also produce transaction ID lists for the found itemsets as part of the returned itemsets object. These lists can then be used for further computation.

Arguments

Objects from the Class

Objects are created by Eclat if the eclat function is called with tidLists = TRUE in the ECparameter object, and returned as part of the mined itemsets. Objects can also be created by coercion from an object of class transactions or by calls of the form new("tidLists", ...).

See Also

[-methods, LIST, eclat, image, length, size, ngCMatrix(in Matrix), itemMatrix-class, itemsets-class, transactions-class

Examples

Run this code
## Create transaction data set.
data <- list(
  c("a","b","c"),
  c("a","b"),
  c("a","b","d"),
  c("b","e"),
  c("b","c","e"),
  c("a","d","e"),
  c("a","c"),
  c("a","b","d"),
  c("c","e"),
  c("a","b","d","e")
  )
data <- as(data, "transactions")

## Mine itemsets with tidLists.
f <- eclat(data, parameter = list(support = 0, tidLists = TRUE))

tl <- tidLists(f)

## Get dimensions of the tidLists.
dim(tl)
dimnames(tl)

## Coerce tidLists to list.
as(tl, "list")

## Inspect visually. 
image(tl)

Run the code above in your browser using DataLab