Identifies numerical indices of the end nodes of a
closely examining the structure of the
rktree flag (obtained via
construct.treeRK()$flag); the precise algorithm used is the following:
if m-th string in the list of
rktree flag is a substring of one or
more of (m + 1),...,n-th strings in the list of flag, then the node
represented by the m-th string of the flag is not an end node; otherwise,
the node represented by the m-th string of the flag is the end node.
A vector that lists the indices of the end nodes of a given
(indices that are consistent to the indices in
flag that are returned by the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
## example: iris dataset ## load the forestRK package library(forestRK) # covariates of training data set x.train <- x.organizer(iris[,1:4], encoding = "num")[c(1:25,51:75,101:125),] y.train <- y.organizer(iris[c(1:25,51:75,101:125),5])$y.new # Construct a tree # min.num.obs.end.node.tree is set to 5 by default; # entropy is set to TRUE by default tree.entropy <- construct.treeRK(x.train, y.train) # Find indices of end nodes of tree.entropy end.node.index <- ends.index.finder(tree.entropy$flag)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.