A Matlab toolbox for pattern recognition Imported pages from 37Steps

Home   Guide   Software   Glossary   FAQ   Blog   About

Where to find the output class of classified objects?

When a test dataset is applied to a trained classifier a new dataset is constructed having the same number of objects but using the classifier outputs for all classes as the object values. This is the dataset D in the below example. This dataset is sometimes called the classification matrix. If the test set contains n objects and the classifier is trained for c classes then D has a size of [n c]. The class confidences or another value for the class similarities are stored in the columns. The feature labeling facility of PRTools is used to give these columns the class names.

W = trainset*fisherc; % classifier training
D = testset*W;        % classification of a test set
labels = D*labeld     % retrieves labels
D*testc               % classifier performance estimate based on testset (using class priors)
D*testd               % classification error of testset (neglecting class priors)

confmat(D)            % confusion matrix

The highest class confidence value points for every object to the class to which it can be assigned best. This is done by the routine labeld. It returns for every object the name (label) of the best class. The routines testc, testd and confmat summarize results by comparing estimated labels (resulting from the columns in D) with the true labels stored in testset and copied into D.