Quantcast

Documentation Center

  • Trial Software
  • Product Updates

resubMargin

Class: ClassificationDiscriminant

Classification margins by resubstitution

Syntax

M = resubMargin(obj)

Description

M = resubMargin(obj) returns resubstitution classification margins for obj.

Input Arguments

obj

Discriminant analysis classifier, produced using fitcdiscr.

Output Arguments

M

Numeric column-vector of length size(obj.X,1) containing the classification margins.

Definitions

Margin

The classification margin is the difference between the classification score for the true class and maximal classification score for the false classes. Margin is a column vector with the same number of rows as in the matrix obj.X. A high value of margin indicates a more reliable prediction than a low value.

For discriminant analysis, the score of a classification is the posterior probability of the classification. For the definition of posterior probability in discriminant analysis, see Posterior Probability.

Examples

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

load fisheriris
obj = fitcdiscr(meas,species);
M = resubMargin(obj);
M(1:25:end)

ans =
    1.0000
    1.0000
    0.9998
    0.9998
    1.0000
    0.9946

See Also

| |

How To

Was this topic helpful?