metrics

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 2 Imported by: 1

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL