conf_mat = confusionmat(y_true, y_pred);
                                % 首先根据数据集上的真实 label 值,和训练算法给出的预测 label 值,
                                % 计算 confusion matrix

conf_mat = bsxfun(@rdivide, conf_mat, sum(conf_mat, 2));
accuracy = mean(diag(conf_mat));
                                % 对角线上的准确率的均值即为最终的 accuracy;

版权声明:本文为mtcnn原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/mtcnn/p/9421471.html