Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

oobPredict

Class: RegressionBaggedEnsemble

Predict out-of-bag response of ensemble

Syntax

Yfit = oobPredict(ens)
Yfit = oobPredict(ens,Name,Value)

Description

Yfit = oobPredict(ens) returns the predicted responses for the out-of-bag data in ens.

Yfit = oobPredict(ens,Name,Value) predicts responses with additional options specified by one or more Name,Value pair arguments.

Input Arguments

ens

A regression bagged ensemble, constructed with fitensemble.

Name-Value Pair Arguments

Specify optional comma-separated 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.

'learners'

Indices of weak learners in the ensemble ranging from 1 to NumTrained. oobLoss uses only these learners for calculating loss.

Default: 1:NumTrained

Output Arguments

Yfit

A vector of predicted responses for out-of-bag data. Yfit has size(ens.X,1) elements.

You can find the indices of out-of-bag observations for weak learner L with the command

~ens.UseObsForLearner(:,L)

Examples

Compute out-of-bag predictions for the carsmall 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

Definitions

expand all

See Also

|

Was this topic helpful?