ggfm.data.ndcg_at_k

class ggfm.data.ndcg_at_k(r, k)[source]

Bases:

Compute the Normalized Discounted Cumulative Gain (NDCG) at rank k.

Parameters:
  • r (list) – A list of relevance scores representing the ranking of items.

  • k (int) – The rank at which to compute NDCG.

Returns:

The Normalized Discounted Cumulative Gain (NDCG) value.

Return type:

float