oblique.tree.complexity: Internal Function that Quantifies the Complexity of Oblique...

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Quantifies the complexity of subtrees of oblique trees

Usage

1
2
3
oblique.tree.complexity(
	tree, 
	subtree.internal.node.names)

Arguments

tree

Fitted model object of class oblique.tree. This is assumed to be the result of some function that produces an object with the same named components as that returned by oblique.tree.

subtree.internal.node.names

A numeric vector containing the names of internal nodes of such a subtree.

Details

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)

Value

A measure of complexity for oblique trees.

Author(s)

A. Truong

References

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.

See Also

oblique.tree.

Examples

 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>"]))

oblique.tree documentation built on April 15, 2017, 4:38 a.m.