![](/img/trans.png)
[英]How to optimize a CNN in Keras using precision (instead of accuracy)
[英]How to optimize the ratio of (True positive)/(False postive) instead of accuracy?
经典指标是“准确率”,与:(真阳性+真阴性)/(假阳性+假阴性)有关
在分类问题中,假阴性比假阳性更容易容忍。 也就是说,我想分配更多的权重来改善(真阳性)/(假阳性)。 如何做到这一点?
model.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])
Tensorflow allows sensitivities to be shifted for these metrics https://www.tensorflow.org/api_docs/python/tf/keras/metrics/SensitivityAtSpecificity , or if you want the false positives directly (which I think only gives you access to the number误报(如果有帮助): https://www.tensorflow.org/api_docs/python/tf/keras/metrics/FalsePositives 。 我对 tensorflow 不太了解,但我希望这会有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.