我对 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/