[label,score]
= oobPredict(ens)
[label,score]
= oobPredict(ens,Name,Value)
[
returns class labels
and scores for label
,score
]
= oobPredict(ens
)ens
for outofbag data.
[
computes
labels and scores with additional options specified by one or more label
,score
]
= oobPredict(ens
,Name,Value
)Name,Value
pair
arguments.

A classification bagged ensemble, constructed with 
Specify optional commaseparated pairs of Name,Value
arguments.
Name
is the argument
name and Value
is the corresponding
value. Name
must appear
inside single quotes (' '
).
You can specify several name and value pair
arguments in any order as Name1,Value1,...,NameN,ValueN
.

Indices of weak learners in the ensemble ranging from Default: 

Classification labels of the same data type as the training
data 

An 
Find the outofbag predictions and scores for the Fisher iris
data. Find the scores in the range (0.2,0.8)
; these
are the scores where there is notable uncertainty in the resulting
classifications.
load fisheriris ens = fitensemble(meas,species,'Bag',100,... 'Tree','type','classification'); [label score] = oobPredict(ens); unsure = ( (score > .2) & (score < .8)); sum(sum(unsure)) % How many uncertain predictions? ans = 16
oobPredict
and predict
similarly predict
classes and responses.
In regression problems:
For each observation that is out of bag for at least
one tree, oobPredict
composes the weighted mean
by selecting responses of trees in which the observation is out of
bag. For this computation, the 'TreeWeights'
namevalue
pair argument specifies the weights.
For each observation that is in bag for all trees,
the predicted response is the weighted mean of all of the training
responses. For this computation, the W
property
of the TreeBagger
model (i.e., the observation
weights) specify the weights.
In classification problems:
For each observation that is out of bag for at least
one tree, oobPredict
composes the weighted mean
of the class posterior probabilities by selecting the trees in which
the observation is out of bag. Consequently, the predicted class is
the class corresponding to the largest weighted mean. For this computation,
the 'TreeWeights'
namevalue pair argument specifies
the weights.
For each observation that is in bag for all trees,
the predicted class is the weighted, most popular class over all training
responses. For this computation, the W
property
of the TreeBagger
model (i.e., the observation
weights) specify the weights. If there are multiple most popular classes, oobPredict
considers
the one listed first in the ClassNames
property
of the TreeBagger
model the most popular.
oobEdge
 oobLoss
 oobMargin
 oobPredict
 predict