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.


Class: RegressionEnsemble

Predict response of ensemble by resubstitution


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


Yfit = resubPredict(ens) returns the response ens predicts for the data ens.X. Yfit is the predictions of ens on the data that fitensemble used to create ens.

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

Input Arguments


A regression ensemble created 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.


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


A vector of predicted responses to the training data, with ens.X elements.


Find the resubstitution predictions of mileage from the carsmall data based on horsepower and weight, and look at their mean square difference from the training data.

load carsmall
X = [Horsepower Weight];
ens = fitensemble(X,MPG,'LSBoost',100,'Tree');
Yfit = resubPredict(ens);
MSE = mean((Yfit - ens.Y).^2)


This is the same as the result of resubLoss:


ans =
Was this topic helpful?