oblique.tree(
formula,
data,
subset,
control = tree.control(nobs, ...),
method = "recursive.partition",
split.impurity = c("deviance", "gini"),
model = FALSE,
oblique.splits = c("only", "on", "off"),
variable.selection = c( "none",
"model.selection.aic",
"model.selection.bic",
"lasso.aic",
"lasso.bic"),
...)
+
(there should be no interaction terms). Both .
and -
are allowed.formula
and subset
.tree.control
."model.frame"
.formula
, data
and subset
to allow direct specification of the problem.only
grows trees that only consider oblique splits, on
grows those that consider oblique and axis-parallel splits simultaneously and off
grows trees that only consider axis-parallel splits.none
grows oblique trees using full oblique splits, model.selection.aic
performs variable selection with AIC from the full model upon the best ideal split, model.selection.bic
similarly for BIC, lasso.aic
applies L1 regularization from the full model and chooses the penalization parameter with AIC and lasso.bic
similarly for BIC.tree.control
. Normally used for mincut
, minsize
or mindev
.c("oblique.tree","tree")
is returned with components
row.names
giving the node numbers. The columns include var
, the variable used to perform each split (where "" denotes an oblique split and ""
a terminal node), n
, the number of cases reaching that node, dev
the deviance of the node, yval
, the class associated to that node, split
, a two-column matrix of the labels for left and right splits at the node and yprob
, a matrix of fitted probabilities for each response level.oblique.tree
.y
is instead used to denote the actual classes)."singlenode"
which inherits from class "tree"
.When growing oblique trees, $2^{R-1}-1$ logistic regression problems need to be (where $R$ is the number of residual classes at a node). If observations come from more than 20 classes this approach will be slow.
Ripley, B. D. (1996). Pattern Recognition and Neural Networks. Cambridge University Press, Cambridge. Chapter 7.
tree.control
in the tree package, predict.oblique.tree
, prune.oblique.tree
, trim.oblique.tree
#create the augmented crabs dataset
data(crabs, package = "MASS")
aug.crabs.data <- data.frame( g=factor(rep(1:4,each=50)),
predict(princomp(crabs[,4:8]))[,2:3])
plot( aug.crabs.data[,-1],type="n")
text( aug.crabs.data[,-1],
col=as.numeric(aug.crabs.data[,1]),
labels=as.numeric(aug.crabs.data[,1]))
#grow a full oblique tree
ob.tree <- oblique.tree(formula = g~.,
data = aug.crabs.data,
oblique.splits = "only")
plot(ob.tree);text(ob.tree)
Run the code above in your browser using DataLab