可视化分类问题_报表

时间:2020-09-05 04:21:52

标签: tensorflow machine-learning scikit-learn

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

enter image description here

我的模型是带有情感分类的Glove嵌入的LSTM,这是一种体系结构:

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 

1 个答案:

答案 0 :(得分:0)

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

import pandas as pd

display(pd.DataFrame.from_dict(classification_report(y_true, y_pred, output_dict=True)).T)