Skip to contents

The mean of the precisions measured at each rank holding a relevant item, divided by \(\min(|rel|, k)\). The competing convention divides by \(|rel|\); it is returned as ap_over_nrel so the two are never silently swapped.

Usage

MapMet(pred_rank, relevant, k)

Arguments

pred_rank

A ranking, or a list of rankings.

relevant

Relevant ids, or a list of such vectors.

k

Cutoff rank.

Value

Named list with estimate, ap, ap_over_nrel, n_queries, k, method.

References

Standard IR metric; no single owning source.

Examples

MapMet(c(1, 2, 3, 4, 5), c(2, 4, 9), 5)
#> $estimate
#> [1] 0.3333333
#> 
#> $ap
#> [1] 0.3333333
#> 
#> $ap_over_nrel
#> [1] 0.3333333
#> 
#> $n_queries
#> [1] 1
#> 
#> $k
#> [1] 5
#> 
#> $method
#> [1] "mean average precision at k"
#>