Predict response of ensemble by resubstitution
Yfit = resubPredict(ens)
Yfit = resubPredict(ens,Name,Value)
A regression ensemble created with fitensemble.
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 NTrained. oobLoss uses only these learners for calculating loss.
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) MSE = 6.4336
This is the same as the result of resubLoss:
resubLoss(ens) ans = 6.4336