Creates QCBA model by from a CBA rule model.
The default values are set so that the function postprocesses CBA models, reducing their size.
The resulting model has the same structure as CBA model: it is composed of an ordered list of crisp conjunctive rules, intended to be applied for one-rule classification.
The experimental annotate
and fuzzification
parameters will trigger more complex postprocessing of CBA models:
rules will be annotated with probability distributions and optionally fuzzy borders. The intended use of such models is multi-rule classification.
The predict function automatically determines whether the input model is a CBA model or an annotated model.
qcba(cbaRuleModel, datadf, extendType = "numericOnly",
defaultRuleOverlapPruning = "transactionBased", attributePruning = TRUE,
trim_literal_boundaries = TRUE, continuousPruning = FALSE,
postpruning = "cba", fuzzification = FALSE, annotate = FALSE,
ruleOutputPath, minImprovement = 0, minCondImprovement = -1,
minConf = 0.5,
extensionStrategy = "ConfImprovementAgainstLastConfirmedExtension",
loglevel = "WARNING", createHistorySlot = FALSE, timeExecution = FALSE)
data frame with training data
possible extend types - numericOnly or noExtend
pruning removing rules made redundant by the default rule; possible values: noPruning
, transactionBased
, rangeBased
, transactionBasedAsFirstStep
remove redundant attributes
trimming of literal boundaries enabled
indicating continuous pruning is enabled
type of postpruning (none
, cba
- data coverage pruning, greedy
- data coverage pruning stopping on first rule with total error worse than default)
boolean indicating if fuzzification is enabled. Multi-rule classification model is produced if enabled. Fuzzification without annotation is not supported.
boolean indicating if annotation with probability distributions is enabled, multi-rule classification model is produced if enabled
path of file to which model will be saved. Must be set if multi rule classification is produced.
parameter ofqCBA extend procedure (used when extensionStrategy=ConfImprovementAgainstLastConfirmedExtension
or ConfImprovementAgainstSeedRule
)
parameter ofqCBA extend procedure
minimum confidence to accept extension (used when extensionStrategy=MinConf)
possible values: ConfImprovementAgainstLastConfirmedExtension
, ConfImprovementAgainstSeedRule
,MinConf
logger level from java.util.logging
creates a history slot on the resulting qCBARuleModel model, which contains an ordered list of extensions that were created on input rules during the extension process
reports execution time of the extend step
Object of class qCBARuleModel.
# NOT RUN {
allData <- datasets::iris[sample(nrow(datasets::iris)),]
trainFold <- allData[1:100,]
testFold <- allData[101:nrow(datasets::iris),]
rmCBA <- cba(trainFold, classAtt="Species")
rmqCBA <- qcba(cbaRuleModel=rmCBA,datadf=trainFold)
print(rmqCBA@rules)
# }
Run the code above in your browser using DataLab