1
$\begingroup$

I have the following data:

predictions = [8;8;8;5;4;3;2;1];
true_target = [1;1;1;0;0;0;0;0];

When I compute the area under the precision recall curve using Matlab ([X,Y,T,AUPR] = perfcurve(true_target,prediction,1,'XCrit','tpr','YCrit','ppv')), I get a value of 0.

The precision at different thresholds are [NaN;1;0.75;0.6;0.5;0.4286;0.375]

The recall at different thresholds are [0;1;1;1;1;1;1];

Mathematically it make sense to me that the area under the precision recall curve is 0, since the precision recall curve looks like a vertical line, due to the tie in the prediction for the positive cases. However, I feel like in this case the 0 value for the area under the precision recall curve is not an indication of a bad classifier, since (1) AUCROC is 1 (2) there is a ideal threshold for precision/recall, e.g. threshold of > 5 gives precision=1 and recall=1;

Am I missing something? how should I interpret/report this?

$\endgroup$

1 Answer 1

0
$\begingroup$

I found a related post below: Starting point of the PR-curve and the AUCPR value for an ideal classifier

To summarize, the issue is "what is the starting point of the precision recall curve". Matlab do not make assumptions about the starting point (i.e. it starts where data is available), which in my case, results in the graph being "incomplete". Python's implementation assumes the graph starts at precision=1, and recall=0;

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.