Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: xclust
See also: cartsplitclass cartsplitregr

Quantlet: cartleafnum
Description: returns number of terminal (leaf) nodes in the tree.

Reference(s):

Link:
Usage: LeafNum = cartleafnum(Tree)
Input:
Tree Complex tree structure, list of different parameters Tree can be generated using CartClassificationSplit or CartRegressionSplit commands
Output:
LeafNumber integer, number of terminal (leaf) nodes in the tree.

Example:
library("xclust");
x = #(1,2,3,4,40,50,60,80,90, 100, 110, 300, 500)~#(10,0,40,60,100,1,-91,20,20,34, 1, 3, -5);
y = #(1,1,1,1,2,1,1,2,3,2, 3, 3, 3)
// create tree
tr = cartsplitclass(x, y, 0, 1)
// return number of leaf nodes in the constructed tree
NumberOfNodes = cartleafnum(tr);
NumberOfNodes

Result:
Contents of NumberOfNodes
[1,]        6



Author: R. Timofeev, A. Andriyashin 20041215 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006