Learn R Programming

arules (version 1.7-2)

associations-class: Class associations - A Set of Associations

Description

The associations class is a virtual class which is extended to represent mining result (e.g., sets of itemsets or rules). The class provides accessors for the quality slot and a method for sorting the associations.

Arguments

Objects from the Class

A virtual class: No objects may be created from it.

Slots

quality:

a data.frame for quality measures (e.g., interest measures as support or confidence). Each quality measure is a named vector with the same length as the number of elements in the set of associations and each vector element belongs to the association with the same index.

info:

a list which is used to store algorithm specific mining information. Typically it contains a least the elements "data" (name of the transaction data set), "ntransactions" (length of the data set), "support" (the minimum support used for mining).

Methods

info<-

signature(x = "associations"); replaces the info list.

info

signature(x = "associations"); returns the info list.

items

signature(x = "associations"); dummy method. This method has to be implemented by all subclasses of associations and return the items which make up each association as an object of class itemMatrix.

labels

signature(object = "associations"); dummy method. This method has to be implemented by all subclasses of associations and return a vector of length(object) of labels for the elements in the association.

length

signature(x = "associations"); dummy method. This method has to be implemented by all subclasses of associations and return the number of elements in the association.

quality<-

signature(x = "associations"); replaces the quality data.frame. The lengths of the vectors in the data.frame have to equal the number of associations in the set.

quality

signature(x = "associations"); returns the quality data.frame.

show

signature(object = "associations")

Details

The implementations of associations store itemsets (e.g., the LHS and RHS of a rule) as objects of class itemMatrix (i.e., sparse binary matrices). Quality measures (e.g., support) are stored in a data.frame accessible via method quality.

Associations can store multisets with duplicated elements. Duplicated elements can result from combining several sets of associations. Use unique to remove duplicate associations.

See Also

sort, write, length, is.subset, is.superset, sets, unique, itemMatrix-class