首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >可视化classification_report的问题

可视化classification_report的问题
EN

Stack Overflow用户
提问于 2020-09-05 12:21:53
回答 1查看 31关注 0票数 0

我正在尝试绘图分类报告,但在我的问题中只有2个类(0和1),当我调用分类报告时,他的输出是:

enter image description here

我的模型是一个带有Glove嵌入的情感分类的LSTM,这是一个架构:

代码语言:javascript
复制
Model: "sequential_6"
_________________________________________________________________
Layer (type)                 Output Shape              Param #   
=================================================================
embedding_6 (Embedding)      (None, 55, 300)           68299200  
_________________________________________________________________
spatial_dropout1d_12 (Spatia (None, 55, 300)           0         
_________________________________________________________________
lstm_12 (LSTM)               (None, 55, 128)           219648    
_________________________________________________________________
lstm_13 (LSTM)               (None, 55, 64)            49408     
_________________________________________________________________
spatial_dropout1d_13 (Spatia (None, 55, 64)            0         
_________________________________________________________________
dense_18 (Dense)             (None, 55, 512)           33280     
_________________________________________________________________
dropout_6 (Dropout)          (None, 55, 512)           0         
_________________________________________________________________
dense_19 (Dense)             (None, 55, 64)            32832     
_________________________________________________________________
dense_20 (Dense)             (None, 55, 1)             65        
=================================================================
Total params: 68,634,433
Trainable params: 335,233
Non-trainable params: 68,299,200 
EN

回答 1

Stack Overflow用户

发布于 2020-09-05 17:58:02

您可以将classification_report的输出定义为dict(),这样您就可以通过pandas.DataFrame.from_dict()将其读取为pandas DataFrame,如下所示:

代码语言:javascript
复制
import pandas as pd

display(pd.DataFrame.from_dict(classification_report(y_true, y_pred, output_dict=True)).T)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63750419

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档