Description Usage Arguments Examples
Creates instance of arc CBAmodel class from the arc package Instance of CBAmodel can then be passed to qcba
1 2 3 4 5 6 7 | 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. |
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.