Learn R Programming

delt (version 0.8.2)

eval.pick: Returns a subtree of an evaluation tree

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

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"

See Also

densplit, prune

Examples

Run this code
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)

Run the code above in your browser using DataLab