Description Usage Arguments Details Value Author(s) References See Also Examples
Quantifies the complexity of subtrees of oblique trees
1 2 3 | oblique.tree.complexity(
tree,
subtree.internal.node.names)
|
tree |
Fitted model object of class |
subtree.internal.node.names |
A numeric vector containing the names of internal nodes of such a subtree. |
R_α(T) = R(T) + α size(T)
When pruning and trimming trees, size(T) must be evaluated. Though counting the number of leaves (tree size) gives an good indication of the complexity of axis-parallel trees, it does not take into account the complexity of each split in oblique trees. This complexity measure generalizes tree size by inflating the cost of each leaf up from 1 for more complex branches. The cost of each leaf is defined to be the number of attributes used along its branch divided the by the number of tests (which coincides with tree size in the case of axis-parallel trees)
A measure of complexity for oblique trees.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #consider various tree on the Pima Indian dataset
data(Pima.tr, package = "MASS")
ob.tree.only <- oblique.tree(formula = type~.,
data = Pima.tr,
oblique.splits = "only")
ob.tree.on <- oblique.tree(formula = type~.,
data = Pima.tr,
oblique.splits = "on")
ob.tree.off <- oblique.tree(formula = type~.,
data = Pima.tr,
oblique.splits = "off")
op <- par(mfrow=c(1,3))
plot(ob.tree.only);text(ob.tree.only);title(main="Oblique Splits Only")
plot(ob.tree.on);text(ob.tree.on);title(main="Oblique Splits On")
plot(ob.tree.off);text(ob.tree.off);title(main="Oblique Splits Off")
par(op)
#calculate the complexity of a subtree
oblique.tree:::oblique.tree.complexity(
tree = ob.tree.only,
subtree.internal.node.names = c(12,13,7))
#calculate the complexity of each tree
oblique.tree:::oblique.tree.complexity(
tree = ob.tree.only,
subtree.internal.node.names
= as.numeric(row.names(ob.tree.only$frame)[ob.tree.only$frame$var == "<leaf>"]))
oblique.tree:::oblique.tree.complexity(
tree = ob.tree.on,
subtree.internal.node.names
= as.numeric(row.names(ob.tree.on$frame)[ob.tree.on$frame$var == "<leaf>"]))
oblique.tree:::oblique.tree.complexity(
tree = ob.tree.off,
subtree.internal.node.names
= as.numeric(row.names(ob.tree.off$frame)[ob.tree.off$frame$var == "<leaf>"]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.