Learn R Programming

arules (version 0.3-1)

random.transactions: Simulate a Random Transaction Data Set

Description

Simulates a random transactions object using different methods.

Usage

random.transactions(nItems, nTrans, method = "independent", ...,
	verbose = FALSE)

Arguments

nItems
"integer"; number of items.
nTrans
"integer"; number of transactions.
method
name of the simulation method used (default: all items occur independently).
...
further arguments used for the specific simulation method (see details).
verbose
report progress.

Value

Details

The function generates a nitems times ntrans transaction database. Currently two simulation methods are implemented: [object Object],[object Object]

References

Michael Hahsler, Kurt Hornik, and Thomas Reutterer (2006). Implications of probabilistic data modeling for mining association rules. In M. Spiliopoulou, R. Kruse, C. Borgelt, A. Nuernberger, and W. Gaul, editors, From Data and Information Analysis to Knowledge Engineering, Proceedings of the 29th Annual Conference of the Gesellschaft fuer Klassifikation e.V., University of Magdeburg, March 9-11, 2005, Studies in Classification, Data Analysis, and Knowledge Organization, pages 598-605. Springer-Verlag.

Rakesh Agrawal and Ramakrishnan Srikant (1994). Fast algorithms for mining association rules in large databases. In Jorge B. Bocca, Matthias Jarke, and Carlo Zaniolo, editors, Proc. 20th Int. Conf. Very Large Data Bases, VLDB, pages 487-499, Santiago, Chile.

See Also

transactions-class.

Examples

Run this code
# generate random 1000 transactions for 200 items with 
 # a success probability decreasing from 0.2 to 0.0001
 # using the method described in Hahsler et al. (2006).
 trans <- random.transactions(nItems = 200, nTrans = 1000, 
	iProb = seq(0.2,0.0001, length=200))
 
 # display random data set
 image(trans)

 # use the method by Agrawal and Srikant (1994) to simulate transactions 
 # which contains correlated items. This should create data similar to
 # T10I4D100K (just only 1000 transactions)
 patterns <- random.patterns(nItems = 1000)
 summary(patterns)

 trans2 <- random.transactions(nItems = 1000, nTrans = 1000, 
	method = "agrawal", patterns = patterns)
 image(trans2)

Run the code above in your browser using DataLab