Learn R Programming

tree (version 1.0-42)

misclass.tree: Misclassifications by a Classification Tree

Description

Report the number of mis-classifications made by a classification tree, either overall or at each node.

Usage

misclass.tree(tree, detail = FALSE)

Value

Either the overall number of misclassifications or the number for each node.

Arguments

tree

Object of class "tree", representing a classification tree.

detail

If false, report overall number of mis-classifications. If true, report the number at each node.

Author

B. D. Ripley

Details

The quantities returned are weighted by the observational weights if these are supplied in the construction of tree.

See Also

tree

Examples

Run this code
ir.tr <- tree(Species ~., iris)
misclass.tree(ir.tr)
misclass.tree(ir.tr, detail=TRUE)

Run the code above in your browser using DataLab