【发布时间】:2020-12-24 06:32:25
【问题描述】:
我尝试了绘图分类报告,但在我的问题中只有 2 个类(0 和 1),当我调用分类报告时,他的输出是:
我的模型是一个带有 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
【问题讨论】:
-
您可以在将
y_pred和y_test的形状传递给argmax 函数之前添加它吗? -
你检查
y_pred是否只包含两个值1和0?
标签: tensorflow machine-learning scikit-learn