Constructs a tree (R.W. Payne).
|Whether to print monitoring information (
||Saves the trees that have been constructed|
||Data available for constructing the trees|
BCONSTRUCT is a utility procedure that is used by the tree procedures like
BREGRESSION to construct trees. It calls a procedure
BSELECT to determine the test to be performed at each node of the tree. Customized versions of this procedure are available for each type of tree, and are accessed automatically along with the top-level procedure for the type of tree concerned.
BCONSTRUCT is thus completely general – and can be used for other types of tree simply by providing an appropriate version of
DATA parameter of
BCONSTRUCT supplies a pointer containing the information required to construct the tree. (This is then passed through to
BSELECT, together with information about the node for which a test is to be selected.) The
TREE parameter saves the tree that has been constructed, and the
monitoring to produce monitoring information during construction.
BCONSTRUCT calls a procedure
BSELECT to decide which test to use at each node of the tree. This must be customized according to the type of tree that is required.
BSELECT has no options. Its parameters are as follows.
||Data for constructing the tree (as provided by the
||Tests already made between the root and the current node|
||Branches taken at each previous node|
||Returns a label to put onto the node|
||or expression New test to be done at the node (expression), or identification made at the node (scalar) if no new test selected|
||Returns the number of branches to insert below the node|
||Other information to store at the node|
||Labels for the other information|
BSELECT has selected a test, the tree is extended by the
BGROW directive, function
BTERMINAL is used to find the next terminal node, and functions
BBRANCHES are used to ascertain the nodes and branches between that node and the root.
The use of any restrictions will depend on the
BSELECT procedure, called by
Commands for: Calculations and manipulation.
CAPTION !t(\ 'Use of tree utility procedure BCONSTRUCT is shown in procedures BKEY',\ 'BCLASSIFICATION & BREGRESSION, whose source code can be accessed by e.g.'),\ ' LIBEXAMPLE ''BCLASSIFICATION''; SOURCE=SourceBclass'