
Reciprocal rank fusion (Kamath Ch 7)
Source:R/kamath_llm2_native.R
morie_kamath_reciprocal_rank_fusion.Rdsum_r 1/(k + rank_r(d)); documents missing from a list simply score nothing there. Ties break on the document label.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_kamath_reciprocal_rank_fusion(V)
#> $ranking
#> [1] "1" "2" "3" "4" "5" "6" "7" "8"
#>
#> $scores
#> 1 2 3 4 5 6 7
#> 0.01639344 0.01639344 0.01639344 0.01639344 0.01639344 0.01639344 0.01639344
#> 8
#> 0.01639344
#>
#> $appearances
#> 1 2 3 4 5 6 7 8
#> 1 1 1 1 1 1 1 1
#>
#> $n_rankers
#> [1] 8
#>
#> $n_documents
#> [1] 8
#>
#> $estimate
#> 1
#> 0.01639344
#>
#> $k
#> [1] 60
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "Reciprocal rank fusion sum 1/(k + rank)"
#>