What happen with confusion matrix ?
3 views (last 30 days)
Hi, Im trying to create confusion matrix, but the result in the green color or true class is not 100%, if the range 1-10 it should be 10,0% but I get 9,1%. please help me if I wrong? or explain why the result like this ?
here the code and result :
targetsVector = ttes.'; % True classes
outputsVector = pred_tes.'; % Predicted classes
% Convert this data to a [numClasses x 55] matrix
targets = zeros(11,55);
outputs = zeros(11,55);
targetsIdx = sub2ind(size(targets), targetsVector, 1:55);
outputsIdx = sub2ind(size(outputs), outputsVector, 1:55);
targets(targetsIdx) = 1;
outputs(outputsIdx) = 1;
the cyclist on 22 Feb 2019
It looks like you have 55 observations. 51 of them were classified correctly (along the diagonal, indicated in green). But 4 of them were misclassified -- two observations with target class 1, but were in output class 7 and two observations with target class 7, but where in output class 5.
Classifiers are not usually perfect, so misclassifications happen. Did you expect your classifier to be perfect? Why?
More Answers (1)
Kevin Chng on 22 Feb 2019
Edited: Kevin Chng on 22 Feb 2019
The result in the green color or true class is not 100%, if the range 1-10 it should be 10,0% but I get 9,1%.
You may find the detail of plotconfusion as below:
In the documentation, it stated :
The diagonal cells correspond to observations that are correctly classified. The off-diagonal cells correspond to incorrectly classified observations. Both the number of observations and the percentage of the total number of observations are shown in each cell.
for example, at the first row and first column, the value is 3 and the percentage is 5.5%.
It means that there are 3 predicted observation classified as Class1, the percentage of 3 of all the observation is 5.5%.