Confusion matrix for visualization of the performance of an algorithm
CM = nan_confusionmat(G,GHAT) CM = nan_confusionmat(G,GHAT,ORDER) [CM, GORDER] = nan_confusionmat(G, GHAT)
actual group labels
predicted group labels
confusion matrix
(vector) species the order of rows (and columns) of the confusion matrix
order of group labels for rows and columns of CM.
The confusion matrix CM(I,J) represents the count of instances whose actual group labels are group I and whose predicted group labels are group J.
predicted Classes
___|_____|______|
actual ' | | |
Classes | | |
If the number of classes is two then the first class is the positive class and the second class is the negative class
CM(1,1) is the number of true positive instances
CM(2,1) is the number of false negative instances
CM(1,2) is the number of false positive instances
CM(2,2) is the number of true negative instances
nan_confusionmat treats NaNs, empty strings or 'undefined' values in G or GHAT as missing values, and removes those entries