Main Content

resubMargin

Resubstitution classification margins for classification tree model

Description

m = resubMargin(tree) returns the resubstitution classification margins m for the trained classification tree model tree using the training data stored in tree.X and the corresponding true class labels stored in tree.Y. m is returned as a numeric column vector with the same length as tree.Y. The software estimates each entry of m using the trained classification tree model tree, the corresponding row of tree.X, and the true class label tree.Y.

example

Examples

collapse all

Find the margins for a classification tree for the Fisher iris data by resubstitution. Examine several entries.

load fisheriris
tree = fitctree(meas,species);
M = resubMargin(tree);
M(1:25:end)
ans =
    1.0000
    1.0000
    1.0000
    1.0000
    0.9565
    0.9565

Input Arguments

collapse all

Classification tree model, specified as a ClassificationTree model object trained with fitctree.

More About

collapse all

Extended Capabilities

expand all

Version History

Introduced in R2011a