tensorflow - Keras 的 AUC(曲线 ='PR' )和 Scikit-learn 的 average_precision_score 有什么区别?

标签 tensorflow keras scikit-learn auc precision-recall

我对 Keras 的 AUC(curve='PR') 和 Scikit-learn 的 average_precision_score 之间的区别感到很困惑。我的目标是计算 Scikit-learn 和 Keras 模型的精确记忆曲线下面积 (AUPRC)。然而,这两个指标会产生截然不同的结果!

我是不是在 https://www.tensorflow.org/api_docs/python/tf/keras/metrics/AUC 的 TensorFlow-Keras 文档中遗漏了什么? , 关于 AUC 函数的使用?

最佳答案

如 Scikit-learn 中所述 documentation ,他们使用不同的实现方法:

References [Manning2008] and [Everingham2010] present alternative variants of AP that interpolate the precision-recall curve. Currently, average_precision_score does not implement any interpolated variant. References [Davis2006] and [Flach2015] describe why a linear interpolation of points on the precision-recall curve provides an overly-optimistic measure of classifier performance. This linear interpolation is used when computing area under the curve with the trapezoidal rule in auc.

average_precision_score 函数中 documentation ,您还可以阅读:

This implementation is not interpolated and is different from computing the area under the precision-recall curve with the trapezoidal rule, which uses linear interpolation and can be too optimistic.

我鼓励您详细查看 metrics module 中提供的不同功能及其描述。 .我还强烈建议阅读 related paper .

最后,这里还有一个可能感兴趣的话题:[AUC] result of tf.metrics.auc doesnot match with sklearn's .

关于tensorflow - Keras 的 AUC(曲线 ='PR' )和 Scikit-learn 的 average_precision_score 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66982988/

相关文章:

tensorflow - 在张量板可视化中调整垂直轴范围

python - LSTM Autoencoder 的这些实现之间的区别?

python - 关联n个坐标点

python - 加载带有标签的 Tensorflow 模型

tensorflow - 用于在 keras 中调用的自定义宏

python - 如何在 Keras 的自定义批量训练中获得每个时期的损失?

python - 为什么在 keras 中增加批处理大小时,使用的 GPU 内存量没有增加?

python - 尝试创建 GAN : InvalidArgumentError: Matrix size-incompatible

python - Scikit-learn 教程出现折旧错误,如何更新?

python - PyTorch 迁移学习教程的混淆矩阵和测试准确性