Read the equation
This relation defines One relevant id at rank two: dcg in the source section “func TestNDCGAtK(t *testing.T) · One relevant id at rank two: dcg”. It specifies the displayed relationship between the named quantities or parameters. Its interpretation depends on the source’s stated variables and conditions; this record does not assign an unprovided physical or cognitive meaning to them.
Terms & definitions
The recovered passage does not supply a separate symbol table. Read the source context for the notation used in this version; familiar letters may carry different meanings in other builds.
How it works
Read One relevant id at rank two: dcg as the quantity being defined or updated by this relation.
Substitute the source-defined variables or recorded values and follow the displayed arithmetic and indexing exactly.
Use this version’s variable definitions and update order. The same symbol may be assigned a different meaning in another build.
Assumptions & limits
This source expression was recovered from the pinned code revision. Its presence does not establish that the associated program was built, run, or scientifically validated.
Original context
Read the surrounding source passage
want float64
}{
// Perfect ranking: relevant ids fill the top, nDCG is 1.0 regardless of their internal order.
{"perfect packed top", []string{"a", "b", "c"}, rel("a", "b"), 3, 1.0},
{"perfect internal order irrelevant", []string{"b", "a", "c"}, rel("a", "b"), 3, 1.0},
// One relevant id at rank one with one irrelevant: ideal is also one relevant at rank one, so 1.0.
{"single relevant at top", []string{"a", "x"}, rel("a"), 2, 1.0},
// One relevant id at rank two: dcg = d2, idcg = d1, so nDCG = d2/d1 = d2.
{"single relevant rank 2", []string{"x", "a"}, rel("a"), 2, d2 / d1},
// One relevant id at rank three (k high enough): dcg = d3, idcg = d1.
{"single relevant rank 3", []string{"x", "y", "a"}, rel("a"), 3, d3 / d1},
// Two relevant ids at ranks one and three: dcg = d1 + d3, idcg = d1 + d2 (two relevant ideal).
{"two relevant ranks 1 and 3", []string{"a", "x", "b"}, rel("a", "b"), 3, (d1 + d3) / (d1 + d2)},
// Reversed: relevant ids at the bottom, both inside k.
{"reversed both in k", []string{"x", "y", "b", "a"}, rel("a", "b"), 4,
(1.0/math.Log2(4) + 1.0/math.Log2(5)) / (d1 + d2)},
// No relevant id in the top k.
{"none in top k", []string{"x", "y", "z"}, rel("a", "b"), 3, 0.0},Exact original notation
One relevant id at rank two: dcg = d2, idcg = d1, so nDCG = d2/d1 = d2.