Summarize a Fitted Tree Object

DESCRIPTION:

Returns a list of summary information on a fitted tree object.

USAGE:

summary.tree(object) 

REQUIRED ARGUMENTS:

object
fitted model object of class tree. This is assumed to be the result of some function that produces an object with the same named components as that returned by the tree function.

VALUE:

The function prints summary information regarding tree type (regression/classification), the call which defines the tree, which variables in the formula are represented in the tree, the number of terminal nodes, the residual deviance, and the distribution of residuals (regression) or misclassification error rate (classification).

DETAILS:

This function is a method for the generic function for class tree. It can be invoked by calling for an object x of the appropriate class, or directly by calling regardless of the class of the object.

SEE ALSO:

, .

EXAMPLES:

z.auto <- tree(Mileage ~ Weight, car.test.frame) 
summary(z.auto) 
# Gives the following output: 
Regression tree: 
tree(formula = Mileage ~ Weightt, data = car.test.frame) 
Number of terminal nodes:  9 
Residual mean deviance:  4.289 = 218.7 / 51 
Distribution of residuals: 
   Min. 1st Qu. Median Mean 3rd Qu.  Max. 
 -3.889  -1.111      0    0   1.083 4.375 
z.survey <- tree(market.survey, na.action = na.exclude)  
summary(z.survey) 
# Gives the following output: 
Classification tree: 
tree(formula = market.survey, na.action = na.omit) 
Number of terminal nodes:  102 
Residual mean deviance:  0.8437 = 554.3 / 657 
Misclassification error rate: 0.1805 = 137 / 759