简体   繁体   English

如何优化(真阳性)/(假阳性)的比率而不是准确性?

[英]How to optimize the ratio of (True positive)/(False postive) instead of accuracy?

The classic metrics is "accuracy", which is related to: (True positive + True negative)/(False positive + False negative)经典指标是“准确率”,与:(真阳性+真阴性)/(假阳性+假阴性)有关

In a classification problem, False negative is more tolerable than false positive.在分类问题中,假阴性比假阳性更容易容忍。 That is, I want to assign more weight to improving (True positive)/(False positive).也就是说,我想分配更多的权重来改善(真阳性)/(假阳性)。 How to accomplish this?如何做到这一点?

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 of false positives if that helps): https://www.tensorflow.org/api_docs/python/tf/keras/metrics/FalsePositives . 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 I do not know much about tensorflow but I hope this helps我对 tensorflow 不太了解,但我希望这会有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用精度(而不是准确性)在 Keras 中优化 CNN - How to optimize a CNN in Keras using precision (instead of accuracy) 自定义 TensorFlow 指标:给定假阳性率下的真阳性率 - Custom TensorFlow metric: true positive rate at given false positive rate 哪个是哪个? (真阳性、真阴性、假阳性、假阴性) - Which one is which ? (True Positive, True Negative, False Positive, False Negative) 具有 is_training 'true' 和 'false' 的 Batchnorm 的不同行为 - 冻结模型的准确度不同 - Different behavior for Batchnorm with is_training 'true' and 'false' - Accuracy is different for frozen models 如何在 tf.keras.metrics 中找到误报率 - how to find false positive rate in tf.keras.metrics CNN 对象检测:如何降低高误报率 - CNN Object detection: How to reduce high false positive rates 如何在Tensorflow中获得精度和召回率而不是准确性 - How can i get precision & recall instead of accuracy in Tensorflow tfjs, [1, 0, 0] 打印为 [true, false false] - tfjs, [1, 0, 0] prints as [true, false false] 每个 epoch 的准确度都是从 0 而不是 1 开始 - Accuracy for every epoch is starting with 0 instead of 1 Tensorflow对象检测API:如何找出误报,误报,真报? - Tensorflow Object Detection API: how to find out false positives, false negatives, true positives?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM