nan_classify Classification nan_fss

NaN Toolbox >> NaN Toolbox > Classification > nan_confusionmat

nan_confusionmat

Confusion matrix for classification algorithms.

Calling Sequence

CM = nan_confusionmat(G,GHAT)
CM = nan_confusionmat(G,GHAT,ORDER)
[CM, GORDER] = nan_confusionmat(G, GHAT)

Parameters

G:

known group labels

GHAT:

predicted group labels

CM :

confusion matrix determined by the known group labels G and the predicted group labels GHAT

ORDER:

if used the order of rows (and columns) of the confusion matrix is specified by ORDER. ORDER is a

GORDER:

order of group labels for rows and columns of CM. GORDER has the same type as G and GHAT.

Description

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.

Examples

// 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);

See also

nan_classify Classification nan_fss