labels = predict(ens,tbl)
labels = predict(ens,X)
labels = predict(___,Name,Value)
[labels,score]
= predict(___)
returns
a vector of predicted class labels for a table labels
= predict(ens
,tbl
)tbl
,
based on ens
, a trained full or compact classification
ensemble.
returns
a vector of predicted class labels for a matrix labels
= predict(ens
,X
)X
,
based on ens
, a trained full or compact classification
ensemble.
predicts
classifications with additional options specified by one or more labels
= predict(___,Name,Value
)Name,Value
pair
arguments, using any of the previous syntaxes.
[
also returns scores for all
classes, using any of the previous syntaxes.labels
,score
]
= predict(___)

A classification ensemble created by 

Sample data, specified as a table. Each row of If you trained 

A matrix where each row represents an observation, and each
column represents a predictor. If you trained 
Specify optional commaseparated 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 Default: 

A logical matrix of size When Default: 

Vector of classification labels. 

A matrix with one row per observation and one column per class.
For each observation and each class, the score generated by each tree
is the probability of this observation originating from this class
computed as the fraction of observations of this class in a tree leaf. 
For ensembles, a classification score represents the confidence of a classification into a class. The higher the score, the higher the confidence.
Different ensemble algorithms have different definitions for their scores. Furthermore, the range of scores depends on ensemble type. For example:
AdaBoostM1
scores range from –∞
to ∞.
Bag
scores range from 0
to 1
.
Train a boosting ensemble for the ionosphere
data,
and predict the classification of the mean of the data:
load ionosphere; ada = fitensemble(X,Y,'AdaBoostM1',100,'tree'); Xbar = mean(X); [ypredict score] = predict(ada,Xbar) ypredict = 'g' score = 2.9460 2.9460