def test_ndcg_minimal():
# Set up data
prediction = np.arange(10).astype(dtype=np.float32)
ground_truth = np.flip(prediction, axis=0)
# Compute and assert nDCG value
assert_equal(ndcg(prediction, ground_truth).data, 0.39253964576233569)
评论列表
文章目录