itemsets-class: Class itemsets - A Set of Itemsets

Description Objects from the Class Slots Extends Methods Author(s) See Also Examples

Description

The 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.

Objects from the Class

Objects are the result of calling the functions 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", ...).

Slots

items:

object of class itemMatrix containing the items in the set of itemsets

quality:

a data.frame containing the quality measures for the itemsets

tidLists:

object of class tidLists containing the IDs of the transactions which support each itemset. The slot contains NULL if no transactions ID list is available (transactions ID lists are only available for eclat).

Extends

Class associations, directly.

Methods

coerce

signature(from = "itemsets", to = "data.frame"); represent the itemsets in readable form

items

signature(x = "itemsets"); returns the itemMatrix representing the set of itemsets

items<-

signature(x = "itemsets"); replaces the itemMatrix representing the set of itemsets

itemInfo

signature(object = "itemsets"); returns the whole item information data frame including item labels

labels

signature(object = "itemsets"); returns labels for the itemsets as a character vector. The labels have te following format: "item1, item2,..., itemn"

itemLabels

signature(object = "itemsets"); returns the item labels used to encode the itemsets as a character vector. The index for each label is the column index of the item in the binary matrix.

summary

signature(object = "itemsets")

tidLists

signature(object = "itemsets"); returns the transaction ID list

Author(s)

Michael Hahsler

See Also

[-methods, apriori, c, duplicated, eclat, inspect, is.maximal, length, match, sets, size, subset, associations-class, tidLists-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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")

arules documentation built on Nov. 17, 2017, 6:02 a.m.