This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Class: TreeBagger

Out-of-bag mean margins


mar = oobMeanMargin(B)
mar = oobMeanMargin(B,'param1',val1,'param2',val2,...)


mar = oobMeanMargin(B) computes average classification margins for out-of-bag observations in the training data, using the trained bagger B. oobMeanMargin averages the margins over all out-of-bag observations. mar is a row-vector of length NTrees, where NTrees is the number of trees in the ensemble.

mar = oobMeanMargin(B,'param1',val1,'param2',val2,...) specifies optional parameter name/value pairs:

'Mode'Character vector or string scalar indicating how oobMeanMargin computes errors. If set to 'cumulative' (default), is a vector of length NTrees where the first element gives mean margin from trees(1), second column gives mean margins from trees(1:2) etc., up to trees(1:NTrees). If set to 'individual', mar is a vector of length NTrees, where each element is a mean margin from each tree in the ensemble. If set to 'ensemble', mar is a scalar showing the cumulative mean margin for the entire ensemble.
'Trees'Vector of indices indicating what trees to include in this calculation. By default, this argument is set to 'all' and the method uses all trees. If 'Trees' is a numeric vector, the method returns a vector of length NTrees for 'cumulative' and 'individual' modes, where NTrees is the number of elements in the input vector, and a scalar for 'ensemble' mode. For example, in the 'cumulative' mode, the first element gives mean margin from trees(1), the second element gives mean margin from trees(1:2) etc.
'TreeWeights'Vector of tree weights. This vector must have the same length as the 'Trees' vector. oobMeanMargin uses these weights to combine output from the specified trees by taking a weighted average instead of the simple nonweighted majority vote. You cannot use this argument in the 'individual' mode.