Predict response of ensemble
Yfit = predict(ens,Xdata)
Yfit = predict(ens,Xdata,Name,Value)
Numeric array with the same number of columns as the array used for creating ens. Each row of Xdata corresponds to one data point, and each column corresponds to one predictor.
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 ens.NumTrained. oobEdge uses only these learners for calculating loss.
A logical matrix of size N-by-NumTrained, where N is the number of observations in ens.X, and NumTrained is the number of weak learners. When UseObsForLearner(I,J) is true, predict uses learner J in predicting observation I.
Find the predicted mileage for a four-cylinder car, with 200 cubic inch engine displacement, 150 horsepower, weighing 3000 lbs, based on the carsmall data:
load carsmall X = [Cylinders Displacement Horsepower Weight]; rens = fitensemble(X,MPG,'LSBoost',100,'Tree'); Mileage = predict(rens,[4 200 150 3000]) Mileage = 20.4982