
itemsets
class represents a set of itemsets and the associated
quality measures.
Note that the class can also represent a multiset of itemsets with duplicated
elements. Duplicated elements can be removed with unique
.
apriori
(e.g., with target="frequent itemsets"
in the parameter list)
or eclat
.
Objects can also be created by calls of the form
new("itemsets", ...)
.associations
, directly.[-methods
,
apriori
,
c
,
duplicated
,
eclat
,
inspect
,
is.maximal
,
length
,
match
,
sets
,
size
,
subset
,
associations-class
,
tidLists-class
data("Adult")
## Mine frequent itemsets with Eclat.
fsets <- eclat(Adult, parameter = list(supp = 0.5))
## Display the 5 itemsets with the highest support.
fsets.top5 <- sort(fsets)[1:5]
inspect(fsets.top5)
## Get the itemsets as a list
as(items(fsets.top5), "list")
## Get the itemsets as a binary matrix
as(items(fsets.top5), "matrix")
## Get the itemsets as a sparse matrix, a ngCMatrix from package Matrix.
## Warning: for efficiency reasons, the ngCMatrix you get is transposed
as(items(fsets.top5), "ngCMatrix")
Run the code above in your browser using DataLab