Description Usage Arguments Details Value Examples
A datastream generator that produces random transactions within a specified range.
1 2 3 |
type |
The type of transaction data to produce. Currently integer is the only option |
setSize |
The size of the set to create transactions from |
maxTransactionSize |
The maximum size for any one transaction |
prob |
function describing the probability for each item in the itemset |
size |
function describing the probably size of any individual transaction |
DSD_Transactions_Random creates a DSD that generates random transactions with a specified set size and max transaction size. It allows for the use of custom functions for the probability of each number in that range, and the probable length of each transaction.
Returns a DSD_Transactions_Random
object (subclass of
DSD_Transactions
, DSD
) which is a list of the defined
params. The params are either passed in from the function or
created internally
1 2 3 4 5 6 7 8 9 10 11 12 13 | #create random transaction datastream
dsd <- DSD_Transactions_Random()
#create with a set size of 50 and a max transaction size of 10
dsd <- DSD_Transactions_Random(setSize=50, maxTransactionSize=10)
#create with custom size function
dsd <- DSD_Transactions_Random(setSize= 50, maxTransactionSize= 10 , size=function(max) rexp(max))
#get a transaction from the datastream
transaction <- get_points(dsd)
transaction
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.