Tensorflow总是预测0 [英] Tensorflow always predicts 0

查看:115
本文介绍了Tensorflow总是预测0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试训练NN进行二进制分类,但使用多类方法,因此(C)= 2.训练和测试数据集的准确性均为〜96%.但是,手动检查显示Tensorflow始终为每个示例选择0.

I'm trying to train a NN for binary classification but using multi-class approach, hence Class (C) =2. The accuracy on both train and test data sets is ~ 96%. However, manual checking reveals that Tensorflow always picks 0 for every example.

我有兴趣了解如何调试此问题以及我做错了什么.非常感谢您的帮助.谢谢.

I'm interested in knowing how to go about debugging this issue and what I am doing wrong. Greatly appreciate your help. Thanks.

(请让我知道我是否太含糊且没有提供足够的信息,以便您找到一个好的解决方案.谢谢.)

(Please let me know if I'm being too vague and not providing enough info in order for you to pinpoint a good solution. Thanks.)

推荐答案

如果您具有96%的准确度,并且所有预测均为0,则您的数据集可能不平衡.您应该平衡它,并使正数和负数类的样本数相同.您还可以为该类添加权重,以更少的样本对更多的类进行惩罚.

If you have 96% accuracy and all predictions are 0 then your dataset is probably imbalanced. You should balance it and make the number of samples from the positive and negative classes the same. You can also add weights for the class, penalizing more the class with less samples.

这篇关于Tensorflow总是预测0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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