Confusion matrix for classification algorithms.
CM = nan_confusionmat(G,GHAT) CM = nan_confusionmat(G,GHAT,ORDER) [CM, GORDER] = nan_confusionmat(G, GHAT)
known group labels
predicted group labels
confusion matrix determined by the known group labels G and the predicted group labels GHAT
if used the order of rows (and columns) of the confusion matrix is specified by ORDER. ORDER is a
order of group labels for rows and columns of CM. GORDER has the same type as G and GHAT.
The confusion matrix CM(I,J) represents the count of instances whose known group labels are group J and whose predicted group labels are group I.
known Classes
___|_____|______|
Predicted ' | | |
Classes | | |
confusionmat treats NaNs, empty strings or 'undefined' values in G or GHAT as missing values, and the corresponding observations are not counted.
// Compute the resubstitution confusion matrix for applying CLASSIFY // on Fisher iris data. loadmatfile("demos/data/iris.mat"); x = meas; y = species; yhat = nan_classify(x,x,y); [cm,order] = nan_confusionmat(y,yhat);