mAP: reflesh
Assume that we want to estimate an unobserved population parameter on the basis of observations . Let be the sampling distribution of , so that is the probability of when the underlying population parameter is . Then the function:
is known as the likelihood function and the estimate:
is the maximum likelihood estimate of .
Now assume that a prior distribution over exists. This allows us to treat as a random variable as in Bayesian statistics. We can calculate the posterior distributionof using Bayes' theorem:
where is density function of , is the domain of .
The method of maximum a posteriori estimation then estimates as the mode of the posterior distribution of this random variable:
The denominator of the posterior distribution (so-called marginal likelihood) is always positive and does not depend on and therefore plays no role in the optimization. Observe that the MAP estimate of coincides with the ML estimate when the prior is uniform (that is, a constant function).
When the loss function is of the form
- Suppose you are answering the questions, if you are right you will get one point, otherwise zero. If our returned result is
1, 0, 0, 1, 1, 1
So your AP calculation looks like this:1/1, 0, 0, 2/4, 3/5, 4/6
- The AP for above example is 0.6917
Average precision[edit]
Precision and recall are single-value metrics based on the whole list of documents returned by the system. For systems that return a ranked sequence of documents, it is desirable to also consider the order in which the returned documents are presented. By computing a precision and recall at every position in the ranked sequence of documents, one can plot a precision-recall curve, plotting precision as a function of recall . Average precision computes the average value of over the interval from to :[9]That is the area under the precision-recall curve. This integral is in practice replaced with a finite sum over every position in the ranked sequence of documents:where is the rank in the sequence of retrieved documents, is the number of retrieved documents, is the precision at cut-off in the list, and is the change in recall from items to .[9]This finite sum is equivalent to:where is an indicator function equaling 1 if the item at rank is a relevant document, zero otherwise.[10] Note that the average is over all relevant documents and the relevant documents not retrieved get a precision score of zero.Some authors choose to interpolate the function to reduce the impact of "wiggles" in the curve.[11][12] For example, the PASCAL Visual Object Classes challenge prior to 2010 (a benchmark for computer vision object detection, the evaluation metric changed after 2010 to effectively sample the curve at all unique recall values.) computes average precision by averaging the precision over a set of evenly spaced recall levels {0, 0.1, 0.2, ... 1.0}:[11][12]where is an interpolated precision that takes the maximum precision over all recalls greater than :- .
An alternative is to derive an analytical function by assuming a particular parametric distribution for the underlying decision values. For example, a binormal precision-recall curve can be obtained by assuming decision values in both classes to follow a Gaussian distribution.[13]Mean average precision[edit]
Mean average precision for a set of queries is the mean of the average precision scores for each query.where Q is the number of queries.
留言
張貼留言