--- title: NDCG keywords: fastai sidebar: home_sidebar summary: "Normalized Discounted Cumulative Gain." description: "Normalized Discounted Cumulative Gain." nb_path: "nbs/metrics/ndcg.ipynb" ---
result = dcg_at_k([3, 2, 3, 0, 1, 2], 6)
result
assert np.round(result,4)==8.0972
result = ndcg_at_k_v2([3, 2, 3, 0, 1, 2], 6, method=1)
result
assert np.round(result,4)==0.9608