# NOT RUN {
data("iris")
# learn a classifier using automatic default discretization
classifier <- CBA(Species ~ ., data = iris, supp = 0.05, conf = 0.9)
classifier
# make predictions for the first few instances of iris
predict(classifier, head(iris))
# inspect the rule base
inspect(rules(classifier))
# learn classifier from transactions
trans <- as(discretizeDF.supervised(Species ~ ., iris), "transactions")
classifier <- CBA(Species ~ Sepal, data = trans, supp = 0.05, conf = 0.9)
classifier
predict(classifier, head(trans))
# }
Run the code above in your browser using DataCamp Workspace