COMMAND(1)

NAME
tprint - print a decision tree

SYNOPSIS
tprint [options] attribute_file tree_file

tprint [options] stem

DESCRIPTION

tprint displays a decision tree built by tgen, or pruned by tprune. The second form uses the stem instead of explicitly specifying the attribute and tree files, and assumes the filenames "stem.attr" and "stem.tree". Some options only apply to counts trees (usually "stem.treec"), and some only apply to class probability trees (usually "stem.tree").

The tree is printed with a pre-order traversal. Each line contains information about a node: test details that lead to that node, and details about the counts, probabilities or other statistics stored at that node. Counts or probabilities are displayed in the same order as they appear in the attribute file. Various options allow details printed of leaf posteriors and code lengths, standard deviations of probabilities, and classification probabilities (in an averaged tree, leaf probabilities usually differ from final probabilities for examples at that leaf).

Using the -t option, a test set can be run through the data to display, at a glance, how the tree classifies the test set. Useful for finding out where in the tree are the most errors made.

To print smoothing details of class probability trees (output using "tprune -b"), including the intermediate leaf probabilities, etc., use the -b option with the -p and -q options. To see an option tree without being swamped by options, use the -O option repeatedly to see different trees extracted from the option structure.

OPTIONS

-b  By default, probabilities displayed using the -p option are for those at the node as used by the classifer tclass. This option instead displays the intermediate probabilities used by the smoothing routines. Should be used with the -p, -q and -i options on class probability trees.

-c  Display counts of training set examples in each class. The counts are printed out in the same order as the classes appear in the attribute file.

-D n
    Only print out tree to depth n.

-d  Display the best class (the decision). Takes account of utilities to choose the least cost decision.

-g  Display log. posterior probabilities (or code lengths) stored in the nodes of a counts tree. Tree must have been grown with the -t flag to tgen. At each leaf node, L labels the log. posterior probability for the leaf. At each test node, SP labels the log. posterior probability of that subtree, N labels the log. prior probability of the test, and dN labels the log. posterior probability of choosing the parameters to the test (the cut or the subset, or 0 for other tests).

-i  Display counts, etc., for interior (non-leaf) nodes as well.

-l  Create line numbers and print with each node.

-O  An option tree is a compact and-or representation of many different trees. Randomly extract a single tree from the option tree in class probability form in tree_file. The tree will be extracted in proportion to its posterior probability and the generation probability (the probability of extracting this tree from the full option tree) displayed.

-p  Display probability of each class, as would be used during classification. If the tree is printed with a depth bound then the probabilities printed for non-leaf nodes represent local probabilities at that node, and may inaccurately represent probabilities used in classification. If the option occurs twice, then display standard deviations as well. See also the -b option.

-q  Display posteriors used by tree averaging routine at each node. At each leaf node, L labels the posterior probability of that leaf node being in a tree (leaf probability). For options, N labels the posterior probability of that option being the test occurring in a tree (test probability). Use with the -b option to see the details used by the smoothing algorithm.

-t test_file
    This processes a test file test_file, as text file of examples as would normally be done by tclass, to produce vectors of class counts at each node. These are printed as for the -c option. The method of handling unknowns can be set using the -U option.

-U n
    How to handle unknowns when classifying. The available methods are:

    1   Send the unknown down each branch with proportion as found in the training set at that node.

    3   Send unknown down the most common branch (the default).

    4   Send the unknown down a single branch chosen with probability proportional to that found in the training set at that node.

-v  Verbose option, display a few extra details about the tree.

-Z  In regular non-smoothed trees, leaf nodes which have zero count are assigned the same class probabilities as their parent. With this flag set, zero-count nodes are assigned the class probabilities found at the root of the tree. In smoothed trees, produced with the -b option to tprune, this option is ignored because smoothing makes class probabilities at empty nodes equal to the priors.

SEE ALSO
tgen(1), thead(1), tclass(1), tprune(1).