Keras 的 AUC(curve='PR') 和 Scikit-learn 的 average_precision_score 有什么区别?
What's the difference between Keras' AUC(curve='PR') and Scikit-learn's average_precision_score?
我对 Keras 的 AUC(curve='PR')
和 Scikit-learn 的 average_precision_score
之间的区别感到很困惑。我的 objective 是为 Scikit-learn 和 Keras 模型计算精确回忆曲线下的面积 (AUPRC)。然而,这两个指标产生了截然不同的结果!
关于 AUC
函数的使用,我是否遗漏了 https://www.tensorflow.org/api_docs/python/tf/keras/metrics/AUC 的 TensorFlow-Keras 文档?
如 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. I also highly recommend to read the related paper 中提供的不同功能及其描述。
最后,这里还有一个可能感兴趣的线程:[AUC] result of tf.metrics.auc doesnot match with sklearn's。
我对 Keras 的 AUC(curve='PR')
和 Scikit-learn 的 average_precision_score
之间的区别感到很困惑。我的 objective 是为 Scikit-learn 和 Keras 模型计算精确回忆曲线下的面积 (AUPRC)。然而,这两个指标产生了截然不同的结果!
关于 AUC
函数的使用,我是否遗漏了 https://www.tensorflow.org/api_docs/python/tf/keras/metrics/AUC 的 TensorFlow-Keras 文档?
如 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. I also highly recommend to read the related paper 中提供的不同功能及其描述。
最后,这里还有一个可能感兴趣的线程:[AUC] result of tf.metrics.auc doesnot match with sklearn's。