Returns a subtree of an evaluation tree

Share:

Description

Returns a subtree of an evaluation tree. The subtree has a specified number of leafs. The evaluation tree is calculated by "densplit" function. To find out the possible values for the number of leaves we use function "prune".

Usage

1
eval.pick(treeseq, leaf)

Arguments

treeseq

an overfitting evaluation tree with information on the possible pruning nodes; output of function "prune"

leaf

positive integer; number of leaves in the subtree to be returned

Value

Returns an evaluation tree, see the documentation of function "eval.cart"

Author(s)

Jussi Klemela

See Also

densplit, prune

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(denpro)
dendat<-sim.data(n=100,seed=5,type="mulmodII")
et<-densplit(dendat)

treeseq<-prune(et)
treeseq$leafs
len<-length(treeseq$leafs)

leaf<-treeseq$leafs[len-10]
leaf
etsub<-eval.pick(treeseq,leaf=leaf)

dp<-draw.pcf(etsub)
persp(dp$x,dp$y,dp$z,phi=25,theta=-120)