【问题标题】:Confusion About Plotting Confusion Matrix MATLAB关于绘制混淆矩阵MATLAB的困惑
【发布时间】:2014-02-17 14:35:41
【问题描述】:

我正在尝试创建一个混淆矩阵:

http://en.wikipedia.org/wiki/Confusion_matrix

到目前为止,我有一个预测标签列表(例如:[1、2、4、5、1])和测试标签(例如:[1、2、5、6、1])。

但是,我在为混淆矩阵创建图时遇到了问题。

我可以用

生成一个
[C,order] = confusionmat(testing_vector, predicted_labels)


C =

         933           0           7           5           3           9          13           2           7           1
           0        1104           5           2           1           1           4           1          16           1
           8           7         885          31          10           3          16          15          55           2
          10           1          25         887           5          31           2          13          22          14
           5           1           9           5         876           2          12           5          19          48
          11           6           8          47          12         719          15          12          50          12
          13           3          12           3           9          26         879           0          12           1
           2          11          17           7           9           1           0         926          12          43
          11          18          11          31          13          48           8          12         799          23
          11           7           5          13          45           5           1          41          31         850


order =

     0
     1
     2
     3
     4
     5
     6
     7
     8
     9

但是,当我尝试使用 plotconfusion 时,我不确定要为参数 targetsoutputs 使用什么。

我尝试将order 用作targets 并将C 用作outputs,但这似乎不起作用。

我走对了吗?

【问题讨论】:

  • 只是为了记录,也许你也会发现这个code很有用:)

标签: matlab matrix machine-learning


【解决方案1】:

使用C = plotConfusion(testing_vector, predicted_labels); confusionmatplotConfusion 内部调用。并且输出C 是从confusionmat 生成的repmat 变换。请参阅他们的source code 了解更多详情。

【讨论】:

    猜你喜欢
    • 2016-01-31
    • 2012-01-20
    • 1970-01-01
    • 1970-01-01
    • 2016-06-04
    • 2017-10-17
    • 1970-01-01
    • 2015-07-31
    相关资源
    最近更新 更多