arulesCBA2arcCBAModel | R Documentation |
Creates instance of arc CBAmodel class from the arc package Instance of CBAmodel can then be passed to qcba
arulesCBA2arcCBAModel(
arulesCBAModel,
cutPoints,
rawDataset,
classAtt,
attTypes
)
arulesCBAModel |
aobject returned by arulesCBA::CBA() |
cutPoints |
specification of cutpoints applied on the data before they were passed to |
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. |
if (! requireNamespace("arulesCBA", quietly = TRUE)) {
message("Please install arulesCBA: install.packages('arulesCBA')")
} else {
## Not run:
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)
## End(Not run)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.