2
$\begingroup$

I am trying to learn what AP (average precision) means and I came across this page: https://towardsdatascience.com/breaking-down-mean-average-precision-map-ae462f623a52

Here is the given formula:

enter image description here

And here is the given example:

enter image description here

This is a little intuitive to be to set the numerator at all red crossed images (false positives) to 0, because at these points, TP seen in the formula is bigger than 0 -- in the 2nd and 3rd predicted positives (which are false) TP seen so far is 1, and in the 6th predicted positive (which is also false), TP is 3. Then why the author used 0 as "TP seen" for them?

$\endgroup$
1
  • $\begingroup$ If we use "TP seen so far" rather than 0 for the numerators of the false positives as well, what we get for the above example would be: (1/3) * (1/1 + 1/2 + 1/3 + 2/4 + 3/5 + 3/6 + 3/7 + 3/8 + ..... + 3/n), which will be bigger than 1. Using 0 provides the formula to result in a maximum average precision of 1. $\endgroup$
    – user5054
    Commented Aug 18, 2019 at 16:52

1 Answer 1

1
$\begingroup$

I read the article diagonally, so maybe I understood it wrong. But, I think the reason for not adding 1/2, 1/3, is just for penalizing even more those delayed true positives.

Because this Average Precision measures "how soon you get your True Positives", or in the words of creator of the post, "quantify the goodness of the sort based on the score function d( , )". So, if you get all your TPs at the beginning, everything is perfect, and your score is 1. But if the TPs do not arrive at the beginning, the score starts to decrease, and returns a number which assess precisely how "late" the TPs come.

So, that said, it could be used in a cumulative way as you say: (1+1/2+1/3+2/4+3/5+4/5)... but it would penalize less the delayed TPs than using it as the author explains

$\endgroup$
2
  • $\begingroup$ Thanks, I get that, but then the formula and example are inconsistent, aren't they? Also, you said "but it would penalize less the delayed TPs than using it as the author explains" -- does the author consider the version I suggest? Or do you refer by "author explains" to the the part that he talks about the fact that we want to penalize false positives? $\endgroup$
    – user5054
    Commented May 24, 2019 at 10:45
  • $\begingroup$ yes, also for me it is incosistent. I think it would be better explained if the formula was written in other way, for example, just adding the condition inside (instead of TP seen --> if TP = TPseen, else: zero) And refering to your second quest... I think the author doesn't consider your version, or at least, I didn't see it. I just wanted to underline that forcing non-TP's 0 would penalize even more the delay. But, depending on what you need, maybe is better to do it as you suggest. $\endgroup$ Commented May 24, 2019 at 10:57

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.