arulesCBA2arcCBAModel {qCBA}R Documentation

arulesCBA2arcCBAModel Converts a model created by arulesCBA so that it can be passed to qCBA

Description

Creates instance of arc CBAmodel class from the arc package Instance of CBAmodel can then be passed to qcba

Usage

arulesCBA2arcCBAModel(
  arulesCBAModel,
  cutPoints,
  rawDataset,
  classAtt,
  attTypes
)

Arguments

arulesCBAModel

aobject returned by arulesCBA::CBA()

cutPoints

specification of cutpoints applied on the data before they were passed to rCBA::build

rawDataset

the raw data (before discretization). This dataset is used to guess attribute types if attTypes is not passed

classAtt

the name of the class attribute

attTypes

vector of attribute types of the original data. If set to null, you need to pass rawDataset.

Examples


if (! requireNamespace("arulesCBA", quietly = TRUE)) {
 message("Please install arulesCBA: install.packages('arulesCBA')")
}  else {
 message("The following code might cause the 'pruning exception' rCBA error on some installations")
 classAtt <- "Species"
 discrModel <- discrNumeric(iris, classAtt)
 irisDisc <- as.data.frame(lapply(discrModel$Disc.data, as.factor))
 arulesCBAModel <- arulesCBA::CBA(Species ~ ., data = irisDisc, supp = 0.1, 
  conf=0.9)
 CBAmodel <- arulesCBA2arcCBAModel(arulesCBAModel, discrModel$cutp,  iris, classAtt)
 qCBAmodel <- qcba(cbaRuleModel=CBAmodel,datadf=iris)
 print(qCBAmodel@rules)
 }



[Package qCBA version 0.5.1 Index]