日萌社
人工智能AI:Keras PyTorch MXNet TensorFlow PaddlePaddle 深度学习实战(不定时更新)
print(classification_report(testY.argmax(axis=1), predictions.argmax(axis=1), target_names=le.classes_))
警告:
UndefinedMetricWarning: Precision and F-score are ill-defined and being set to 0.0 in labels with no predicted samples.
'precision', 'predicted', average, warn_for)
UndefinedMetricWarning:精度和F分数定义不明确,在没有预测样本的标签中设置为0.0。
分析:
该为警告,不是错误。
比如真实标签的类型是0和1,但是预测的标签仅有其中一种(或仅有0或仅有1),那么就会报出该警告。