混淆矩阵分类报告-Keras [英] Confusion Matrix Classification Report - Keras

查看:173
本文介绍了混淆矩阵分类报告-Keras的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行从git中挑选的代码,以了解其工作原理. 这是我可以理解的准确性/损失,但我需要帮助来阐明此混淆矩阵和报告.需要您的帮助.

I was running a code picked from git to understand how it works. Here is my accuracy/loss that I can understand , but I need help to articulate this confusion matrix and the report. Need you help in this.

损耗:0.0553-acc:0.9826-val_loss:0.0492-val_acc:0.9825

loss: 0.0553 - acc: 0.9826 - val_loss: 0.0492 - val_acc: 0.9825

混乱矩阵

[[22 10 11  1 15  8  8  8 26 15 14 25  3 33 20]
 [ 9  3  7  3 13  6  2  5  8  6  8  3  0 16 17]
 [11  6  8  0  8  5  1  4  7  9  8  6  1 20 12]
 [ 3  0  2  0  0  2  0  0  2  2  2  2  0  4  2]
 [25  8  3  4 18 10  7  8 11 11 10  7  2 23 11]
 [12  3  4  2  7 13 10  3 15  6  7  3  3 19  9]
 [ 7  5  4  3  5  6  8  4  7  4  7  8  2 19 12]
 [ 6  6  3  0  9  7  7  4  6  8  7  6  2 23  6]
 [18  8  7  2 16  8 10 17 20 25 22 12  3 28 14]
 [17  9 10  3 15  6  7  8 16 15 15 21  0 33 13]
 [15  5  7  3 13 15  8  9 12  8 10 14  2 32 14]
 [17  8  7  0  7  7  6  8 12 15  8  9  3 32 11]
 [ 2  2  1  0  1  1  5  0  4  4  4  3  0  1  1]
 [38 22 26  2 20 15 19 13 41 34 24 20  7 50 23]
 [14  9  9  0 11 11  9  7 18 20 16 14  1 22 14]]

下面是分类报告.

Classification Report
          precision    recall  f1-score   support

     A       0.10      0.10      0.10       219
     B       0.03      0.03      0.03       106
     C       0.07      0.08      0.07       106
     D       0.00      0.00      0.00        21
     E       0.11      0.11      0.11       158
     F       0.11      0.11      0.11       116
     G       0.07      0.08      0.08       101
     H       0.04      0.04      0.04       100
     I       0.10      0.10      0.10       210
     J       0.08      0.08      0.08       188
     K       0.06      0.06      0.06       167
     L       0.06      0.06      0.06       150
     M       0.00      0.00      0.00        29
     N       0.14      0.14      0.14       354
     O       0.08      0.08      0.08       175


   micro avg       0.09      0.09      0.09      2200
   macro avg       0.07      0.07      0.07      2200
weighted avg       0.09      0.09      0.09      2200

请帮助我了解分类报告.我读了有关混淆矩阵的理论,但无法清晰地表达出喀拉拉邦的输出.另外,什么是微平均,微平均等.需要帮助来了解.以上精度似乎还不错.请原谅我,我对此很陌生.

Please help me to understand the classification report. I read theory for confusion matrix but unable to articulate this keras output. Also, what is micro avg,mcro avg etc .Need help to understand . Is the above accuracy seems fine. Please pardon me, I am very new to this.

推荐答案

我想您最努力地使用微型平均技术. 精度,召回率和f1是非常基础的,您可以在此处:

I guess you are struggeling with micro avg the most. Precision, recall and f1 are very basic and you will find a clean explanation here:

对于Micro Avg,您可以找到一个很好的示例

For Micro Avg you can find a good example here: But basically it is just an different way to calculate the average.

微观和宏观平均值(无论采用何种度量标准)将略有计算 不同的事物,因此它们的解释也不同.一种 宏平均将为每个类别独立计算指标,并且 然后取平均值(因此平等对待所有班级),而 微观平均将汇总所有类别的贡献 计算平均指标.在多类别分类设置中, 如果您怀疑有可能上课,可以选择微观平均 不平衡(即,与一门课相比,一门课的例子可能更多 其他课程).

Micro- and macro-averages (for whatever metric) will compute slightly different things, and thus their interpretation differs. A macro-average will compute the metric independently for each class and then take the average (hence treating all classes equally), whereas a micro-average will aggregate the contributions of all classes to compute the average metric. In a multi-class classification setup, micro-average is preferable if you suspect there might be class imbalance (i.e you may have many more examples of one class than of other classes).

从此处引用

这篇关于混淆矩阵分类报告-Keras的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆