?? confusion_matrix.m
字號:
function CM = Confusion_matrix(train_predicts, train_targets)
% solve the confusion matrix of classifiers
% Inputs:
% predicts - the predicting class by single classifiers
% targets - the real class of each pattern
% Outputs:
% CM - confusion matrix
%
% Notice: available for only two classes
[nClassifiers, nPatterns] = size(train_predicts);
nClasses = max(train_targets) + 1;
CM = zeros(nClasses, nClasses, nClassifiers);
for i = 1: nClassifiers
for j = 1: nPatterns
CM(train_targets(j)+1, train_predicts(i,j)+1, i) = CM(train_targets(j) + 1, train_predicts(i,j) + 1, i) + 1;
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -