idaArule(
data,
tid,
item,
maxlen=5,
maxheadlen=1,
minsupport=NULL,
minconf=0.5,
nametable=NULL,
namecol=NULL,
modelname=NULL
)
idaApplyRules(modelname, newdata, tid, item)ida.data.frame object pointing to the data to be mined.nametable was specified.idaArule returns an object of class rules compatible with the packages arules and arulesViz
idaApplyRules returns an object of class ida.data.frame, pointing to a table that contains a mapping between transaction IDs and matched
rules.idaArule finds association rules in transactional data. The input data must be in transactional format, thus each
row of the table contains exactly one item and an identifier of which transaction this item is assigned to. These two
columns need to be specified using the tid and item parameters. If the items are referred to with numeric IDs in the
transaction table, it is often useful to add a name mapping to produce rules that contain names instead of item IDs. This can be
achieved by setting the parameters nametable and namecol.
Models are stored persistently in database under the name modelname. Model names cannot have more than 64 characters and
cannot contain white spaces. They need to be quoted like table names, otherwise they will be treated upper case by default. Only one
model with a given name is allowed in the database at a time. If a model with modelname already exists, you need to drop it with idaDropModel
first before you can create another one with the same name. The model name can be used to retrieve the model later (idaRetrieveModel).
idaApplyRules applies a rule model stored in the database to a table with transactions.idf <- ida.data.frame("GOSALES.ORDER_DETAILS")
r <- idaArule(idf,tid="ORDER_NUMBER",item="PRODUCT_TYPE_CODE",minsupport=0.01)
inspect(r)
applyResult <- idaApplyRules(idaGetModelname(r),idf,"ORDER_NUMBER","PRODUCT_NUMBER")Run the code above in your browser using DataLab