Main Content

resubMargin

Resubstitution classification margins for discriminant analysis classifier

    Description

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

    example

    Examples

    collapse all

    Find the margins for a discriminant analysis classifier for Fisher's iris data by resubstitution. Examine several entries.

    Load Fisher's iris data set.

    load fisheriris

    Train a discriminant analysis classifier.

    Mdl = fitcdiscr(meas,species);

    Compute the resubstitution margins, and display several of them.

    m = resubMargin(Mdl);
    m(1:25:end)
    ans = 6×1
    
        1.0000
        1.0000
        0.9998
        0.9998
        1.0000
        0.9946
    
    

    Input Arguments

    collapse all

    Discriminant analysis classifier, specified as a ClassificationDiscriminant model object trained with fitcdiscr.

    More About

    collapse all

    Version History

    Introduced in R2011b

    expand all