i'm plotting ROC curves and precision-recall curves to evaluate various classification models for a problem i'm working on. i've noticed that scikit-learn has some nice convenience functions for computing such curves:
- sklearn.metrics.roc_curve for FPR and TPR
- sklearn.metrics.det_curve for FPR and FNR
- sklearn.metrics.precision_recall_curve for precision and recall
Is there a method (maybe hidden) that calculates all of these in one call? Or maybe that returns counts of TP, TN, FP, and FN (from which one could compute arbitrary metrics) and the associated thresholds?
for example,
fp, tp, fn, tn, thresholds = sklearn.metrics.errors_curve(y_true, y_score)
I could in theory compute precision and recall from the ROC curve (TPR and FPR), because I know the true counts of positives and negatives in my data. But I'd like to use a library to do this so I don't have to worry about the math.