Library: | xclust |
See also: | cartsplitclass |
Quantlet: | cartsplitregr | |
Description: | builds the regression tree. |
Usage: | Tree = cartsplitregr(VarMatrix,ClassVector,MinSize) | |
Input: | ||
VarMatrix | n x m matrix, variables | |
ClassVector | n x 1 vector, classes | |
MinSize | scalar, stop condition, minimum number of observations in terminal node | |
Output: | ||
Tree | list of vectors, composed of: Variable - number of variable of the split questions SplitValue - critical value of the question Class - dominating class of the current node (class with maximum number of observations) Impurity - missclassification error for each node (between 0 and 1) NumberOfPoints - total number of points (all classes) in current node ParentNode - records of parent node Index - used for transformation from XploRe to dll and back DrawIndex - used for drawing trees in XploRe |
library("xclust"); x1 = #(0.898473738, 0.852630806, 0.539114276, 0.241251175, 0.476125641, 0.284315731, 0.0181318590) x2 = #(0.255756912, 0.303028656, 0.146633917, 0.121365982, 0.4111506, 0.97609203, 0.514180304) x = x1~x2; y = #(1.1, 1.2, 1.3, 0.1, 1.45, 2.2, 1.465) tr = cartsplitregr(x,y,1) cartdisptree(tr)
Generates data structure tr representing a binary tree.