python里什么模块可以计算精度-召回(precision-recall)的AUC?
1个回答
使用sklearn.metrics.average_precision_score
>>> import numpy as np
>>> from sklearn.metrics import average_precision_score
>>> y_true = np.array([0, 0, 1, 1])
>>> y_predict = np.array([0.1, 0.4, 0.35, 0.8])
>>> average_precision_score(y_true, y_predict)
0.791666666