Class: ClassificationDiscriminant
Predict resubstitution labels of discriminant analysis classification model
label = resubPredict(obj)
[label,posterior]
= resubPredict(obj)
[label,posterior,cost]
= resubPredict(obj)
returns
the labels label = resubPredict(obj)obj predicts for the data obj.X. label is
the predictions of obj on the data that fitcdiscr used to create obj.
[ returns the posterior
class probabilities for the predictions.label,posterior]
= resubPredict(obj)
[ returns the predicted
misclassification costs per class for the resubstituted data.label,posterior,cost]
= resubPredict(obj)
|
Discriminant analysis classifier, produced using |
|
Response |
|
|
|
|
Find the total number of misclassifications of the Fisher iris data for a discriminant analysis classifier:
load fisheriris
obj = fitcdiscr(meas,species);
Ypredict = resubPredict(obj); % the predictions
Ysame = strcmp(Ypredict,species); % true when ==
sum(~Ysame) % how many are different?
ans =
3