tl =
1 1 1
1 1 2
2 2 2
pl =
1 1 1
2 1 1
2 2 2
>> confusionmat(double(tl(:)), double(pl(:)), 'order', 1:2+1)
ans =
4 1 0
1 3 0
0 0 0
>> conf_mat = confusionmat(double(tl(:)), double(pl(:)), 'order', 1:2)
conf_mat =
4 1
1 3
>> sum(conf_mat, 2)
ans =
5
4
>> nrm(:,ones(1,size(conf_mat,2)))
ans =
5 5
4 4
>> conf_mat./nrm(:, ones(1,size(conf_mat,2)))
ans =
0.8000 0.2000
0.2500 0.7500
No comments:
Post a Comment