| Contents | Index |
Predict ensemble response by resubstitution
label = resubPredict(ens)
[label,score]
= resubPredict(ens)
[label,score]
= resubPredict(ens,Name,Value)
label = resubPredict(ens) returns the labels ens predicts for the data ens.X. label is the predictions of ens on the data that fitensemble used to create ens.
[label,score] = resubPredict(ens) also returns scores for all classes.
[label,score] = resubPredict(ens,Name,Value) finds resubstitution predictions with additional options specified by one or more Name,Value pair arguments.
ens |
A classification ensemble created with fitensemble. |
Specify optional comma-separated pairs of Name,Value arguments, where 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 NTrained. oobLoss uses only these learners for calculating loss. Default: 1:NTrained |
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.
Find the total number of misclassifications of the Fisher iris data for a classification ensemble:
load fisheriris
ens = fitensemble(meas,species,'AdaBoostM2',100,'Tree');
Ypredict = resubPredict(ens); % the predictions
Ysame = strcmp(Ypredict,species); % true when ==
sum(~Ysame) % how many are different?
ans =
5resubEdge | resubLoss | resubMargin | resubPredict
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |