Solved – Average multiple precision recall curves

curvesprecision-recallpresentation

I have a binary classifier that I evaluate using cross validation. The classifier gives me a score for each observation and for each of the test sets I use a varying threshold to compute precision and recall values. Similar as to described in Threshold in precision/recall curve.

I can plot the precision recall values for each set as a curve by connection the entries/points with lines, but how would I average the different precision recall curves into one?

My first idea would be to use a for-loop to go through all recall values and try to (sub)sample precision values, but that seems to be very un-elegant.

How do you do it the right way?enter image description here

Best Answer

I just ended up using an 'engineering' approach and used an optimized function for interpolation.

In my case: http://docs.scipy.org/doc/numpy/reference/generated/numpy.interp.html