# Build a single tree
bt <- brifTree(Species ~., data = iris, depth = 3)
# Print out the decision rules
printRules(bt)
# Get the accuracy on the training set
sum(predict(bt, newdata = iris, type = 'class') == iris[,'Species'])/nrow(iris)
Run the code above in your browser using DataLab