brifTree {brif} | R Documentation |
This is a wrapper for brif
to build a single tree of a given depth. See brifTree.default
and brifTree.formula
for details.
brifTree(x, ...)
x |
a data frame or a |
... |
arguments passed on to |
an object of class brif
. See brif.default
for details.
# 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)