Classification margins by resubstitution
Find Margins for Classification Tree by Resubstitution
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
M — Classification margins
numeric column vector
Classification margins, returned as a numeric column vector of length
Classification margin is the difference between classification score for the true class and maximal classification score for the false classes. A high value of margin indicates a more reliable prediction than a low value.
For trees, the score of a classification of a leaf node is the posterior probability of the classification at that node. The posterior probability of the classification at a node is the number of training sequences that lead to that node with the classification, divided by the number of training sequences that lead to that node.
For an example, see Posterior Probability Definition for Classification Tree.
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Introduced in R2011a