qcba {qCBA} | R Documentation |
qCBA Quantitative CBA
Description
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.
Usage
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,
computeOrderedStats = TRUE
)
Arguments
cbaRuleModel |
|
datadf |
data frame with training data |
extendType |
possible extend types - numericOnly or noExtend |
defaultRuleOverlapPruning |
pruning removing rules made redundant by the default rule; possible values: |
attributePruning |
remove redundant attributes |
trim_literal_boundaries |
trimming of literal boundaries enabled |
continuousPruning |
indicating continuous pruning is enabled |
postpruning |
type of postpruning ( |
fuzzification |
boolean indicating if fuzzification is enabled. Multi-rule classification model is produced if enabled. Fuzzification without annotation is not supported. |
annotate |
boolean indicating if annotation with probability distributions is enabled, multi-rule classification model is produced if enabled |
ruleOutputPath |
path of file to which model will be saved. Must be set if multi rule classification is produced. |
minImprovement |
parameter of qCBA extend procedure (used when |
minCondImprovement |
parameter of qCBA extend procedure |
minConf |
minimum confidence to accept extension (used when extensionStrategy=MinConf) |
extensionStrategy |
possible values: |
loglevel |
logger level from |
createHistorySlot |
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 |
timeExecution |
reports execution time of the extend step |
computeOrderedStats |
appends orderedConf and orderedSupp quality metrics to the resulting dataframe. Setting this parameter to FALSE will reduce the training time. |
Value
Object of class qCBARuleModel.
Examples
allData <- datasets::iris[sample(nrow(datasets::iris)),]
trainFold <- allData[1:100,]
rmCBA <- cba(trainFold, classAtt="Species")
rmqCBA <- qcba(cbaRuleModel=rmCBA,datadf=trainFold)
print(rmqCBA@rules)