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;

相关文章:

  • 2021-11-19
  • 2021-07-28
  • 2021-10-23
  • 2021-07-05
  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-04-14
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
相关资源
相似解决方案