Description Usage Arguments Details Value Author(s) References See Also Examples
An oblique tree is grown by binary recursive partitioning using the response in the specified formula with oblique splits composed of linear combinations of terms from the right-hand-side.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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"),
...)
|
formula |
A formula expression. The left-hand-side (response) should be a factor. The right-hand-side should be a series of numeric or factor variables separated by |
data |
A data frame in which to interpret |
subset |
An expression specifying the subset of cases to be used. |
control |
A list as returned by |
method |
A character string specifying the method to use. The only other useful value is |
split.impurity |
Splitting criterion to use. |
model |
A model frame containing a response and predictors that can be used in place of |
oblique.splits |
If and how oblique splits should be used during tree-growth. |
variable.selection |
If and how concise oblique splits should be found during tree-growth. |
... |
Additional arguments that are passed to |
An oblique tree is grown by binary recursive partitioning using the response in the specified formula and by choosing splits composed of terms from the right-hand-side. Where categorical attributes are considered levels of unordered factors are divided into two non-empty groups, where axis-parallel splits are considered numeric variables are divided into X < a and X ≥q a and where oblique splits are considered numeric variables are divided into ∑ aX < c and ∑ aX ≥q c. The split that maximizes the reduction in impurity is chosen and the process repeated. Splitting continues until the terminal nodes are either pure, sufficiently pure or too small to be split.
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.
An object of class c("oblique.tree","tree")
is returned with components
frame |
A data frame with a row for each node and |
where |
A vector indicating the row number of the frame detailing the node to which each case is assigned. |
terms |
The terms of the formula. |
call |
The matched call to |
y |
Predicted classes of each observation by the tree (this differs from the implementation in the tree package where |
A tree with no splits is of class "singlenode"
which inherits from class "tree"
.
A. Truong
Truong. A (2009) Fast Growing and Interpretable Oblique Trees via Probabilistic Models
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.