2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
NDCG, full nameNormalized discounted cumulative gain(Normalized Discounted Cumulative Gain) is a commonly used indicator to measure the quality of search engine and recommendation system results. NDCG takes into accountThe relevance of the results and the ranking position of the results, whose value is between 0 and 1, and the larger the value, the higher the quality of the search results.
The steps to calculate NDCG are as follows:
Calculate DCG (Discounted Cumulative Gain): For a given list of search results, the DCG calculation formula is:Among them, reli represents the i-th one in the result listRelevance score of the results, p isThe length of the resulting list。
计算IDCG(Ideal Discounted Cumulative Gain): IDCG is the ideal DCG, that is, the DCG when the results are sorted by relevance. It is calculated in the same way as DCG, except that the result list is sorted in descending order of relevance.
Calculate NDCG: NDCG normalizes DCG so that its value is between 0 and 1. The specific formula is: