Syntax
Yfit = oobPredict(ens)
Yfit = oobPredict(ens,Name,Value)
Description
returns the predicted responses for the out-of-bag data inYfit
= oobPredict(ens
)ens
.
predicts responses with additional options specified by one or moreYfit
= oobPredict(ens
,Name,Value
)Name,Value
pair arguments.
Input Arguments
|
A regression bagged ensemble, constructed with |
Name-Value Pair Arguments
Specify optional comma-separated pairs ofName,Value
arguments.Name
is the argument name andValue
is the corresponding value.Name
must appear inside single quotes (' '
). You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN
.
|
Indices of weak learners in the ensemble ranging from Default: |
Output Arguments
|
A vector of predicted responses for out-of-bag data. You can find the indices of out-of-bag observations for weak learner ~ens.UseObsForLearner(:,L) |
Examples
Compute out-of-bag predictions for thecarsmall
data. Look at the first three terms of the fit:
load carsmall X = [Displacement Horsepower Weight]; ens = fitensemble(X,MPG,'bag',100,'Tree',... 'type','regression'); Yfit = oobPredict(ens); Yfit(1:3) % first three terms ans = 15.7964 14.7162 14.8062