Build a classifier using a naive rule-weighting algorithm. The algorithm is currently in development, and is not yet formally documented.
wCBA(formula, data, support = 0.2, confidence = 0.8,
verbose = FALSE, parameter = NULL, control = NULL,
sort.parameter = NULL, lhs.support = FALSE, class.weights = NULL,
disc.method = "mdlp")
A symbolic description of the model to be fitted. Has to be of form class ~ .
. The class is the variable name (part of the item label before =
).
A data.frame containing the training data.
Minimum support and confidence for creating association rules.
Optional logical flag to allow verbose execution, where additional intermediary execution information is printed at runtime.
Optional parameter and control lists for apriori.
Ordered vector of arules interest measures (as characters) which are used to sort rules in preprocessing.
Logical variable, which, when set to default value of True, indicates that LHS support should be used for rule mining.
Weights that should be assigned to the rows of each class (ordered by appearance in levels(classColumn))
Discretization method for factorizing numeric input (default: "mdlp"
). See discretizeDF.supervised
for more supervised discretization methods.
Returns an object of class CBA
representing the trained classifier
with fields:
the classifier rule base.
deault class label.
levels of the class variable.
Mines association rules on input data and creates a weighted-vote classifier where a rules weight is the product of its support and confidence. Default class is set to the most common class in the training data.
# NOT RUN {
data("iris")
classifier <- wCBA(Species ~ ., data = iris, supp = 0.05, conf = 0.9)
predict(classifier, head(iris))
# }
Run the code above in your browser using DataLab