prune                  package:delt                  R Documentation

_P_r_e_p_a_r_e_s _f_o_r _p_r_u_n_i_n_g _a_n _o_v_e_r_f_i_t_t_i_n_g _e_v_a_l_u_a_t_i_o_n _t_r_e_e

_D_e_s_c_r_i_p_t_i_o_n:

     Finds a sequence of nodes of an overfitting evaluation tree which
     are candidates to be the pruning nodes. Pruning a tree means
     removing a branch starting from a node.

_U_s_a_g_e:

     prune(et)

_A_r_g_u_m_e_n_t_s:

      et: an evaluation tree; output of "eval.cart", "densplit", ...

_V_a_l_u_e:

     A list containing the following components.  

    tree: the original tree which was given as the input

delnodes : vector giving a sequence of nodes in the order in which we
          should prune the branches starting from these nodes  

  delend: vector whose length is the number of subtrees of the original
          tree. With the help of "delend" we define the subtrees.
          Elements of "delend" define a sequence of nodes from
          "delnodes" in the  following way: (1:delend[1]) is the first
          sequence, (delend[1]+1:delend[2]) is the second sequence, and
          so on. Then, i:th subtree is the result of pruning branches
          away whose roots are the nodes which are the first delend[i]
          elements of delnodes.

   leafs: vector whose length is the number of subtrees of the original
          tree; number of leafs of the subtrees

    alfa: vector whose length is the number of subtrees of the original
          tree; value of the corresponding alfa (complexity parameter)
          for every subtree

  loglik: vector whose length is the number of subtrees of the original
          tree; the value of the likelihood criterion for the subtree

_A_u_t_h_o_r(_s):

     Jussi Klemel

_S_e_e _A_l_s_o:

     'densplit', 'eval.pick'

_E_x_a_m_p_l_e_s:

     dendat<-sim.data(n=200,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)

