Description Usage Arguments Value See Also Examples
Applies qcba rule model on provided data. Automatically detects whether one-rule or multi-rule classification is used
1 2 3 4 5 6 7 8 9 10 11 12 |
object |
qCBARuleModel class instance |
newdata |
data frame with data |
testingType |
either |
loglevel |
logger level from |
outputFiringRuleIDs |
if set to TRUE, instead of predictions, the function will return one-based IDs of rules used to classify each instance (one rule per instance). |
outputConfidenceScores |
if set to TRUE, instead of predictions, the function will return confidences of the firing rule |
confScoreType |
applicable only if 'outputConfidenceScores=TRUE', possible values 'ordered' for confidence computed only for training instances reaching this rule, or 'global' for standard rule confidence computed from the complete training data |
positiveClass |
This setting is only used if 'outputConfidenceScores=TRUE'. It should be used only for binary problems. In this case, the confidence values are recalculated so that these are not confidence values of the predicted class (default behaviour of 'outputConfidenceScores=TRUE') but rather confidence values associated with the class designated as positive |
... |
other arguments (currently not used) |
vector with predictions.
qcba
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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)
prediction <- predict(rmqCBA,testFold)
acc <- CBARuleModelAccuracy(prediction, testFold[[rmqCBA@classAtt]])
message(acc)
firingRuleIDs <- predict(rmqCBA,testFold,outputFiringRuleIDs=TRUE)
message("The second instance in testFold was classified by the following rule")
message(rmqCBA@rules[firingRuleIDs[2],1])
message("The second instance is")
message(testFold[2,])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.