Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeNDCG ¶
func ComputeNDCG[T comparable](ranking []T, relevance map[T]float64, k int) float64
ComputeNDCG calculates the Normalized Discounted Cumulative Gain at rank k. ranking contains ordered result identifiers, while relevance maps identifiers to non-negative relevance grades. When k <= 0 the cutoff defaults to the number of available relevance grades.
func NDCGAtK ¶
func NDCGAtK[T comparable](ranking []T, relevance map[T]float64, k int) float64
NDCGAtK deduplicates the ranking sequence and computes NDCG at the given cutoff. This is useful when the ranking may contain multiple hits for the same logical document (e.g. chunked search results). The first occurrence is kept to preserve ordering and significance.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.