zoukankan      html  css  js  c++  java
  • 推荐系统

    推荐系统评价指标

    1. Precision 精度    intersectionSize / numRecommendedItems

    2. Recall 召回率  intersectionSize / numRelevantItems

    3.  Fall-out (numRecommendedItems - intersectionSize)/(numItems - numRelevantItems)

    4. nDCG

      double cumulativeGain = 0.0;   

        double idealizedGain = 0.0;   

        for (int i = 0; i < recommendedItems.size(); i++) {   

          RecommendedItem item = recommendedItems.get(i);   

          double discount = i == 0 ? 1.0 : 1.0 / log2(i + 1);     

        if (relevantItemIDs.contains(item.getItemID())) {    

           cumulativeGain += discount;   

          }       

      // otherwise we're multiplying discount by relevance 0 so it doesn't do anything

            // Ideally results would be ordered with all relevant ones first, so this theoretical      

       // ideal list starts with number of relevant items equal to the total number of relevant items    

         if (i < relevantItemIDs.size()) {        

       idealizedGain += discount;       

      }      

    }      

    nDCG.addDatum(cumulativeGain / idealizedGain);

    In computing, assume relevant IDs have relevance 1 and others 0

  • 相关阅读:
    [题解]Magic Line-计算几何(2019牛客多校第三场H题)
    [题解]Crazy Binary String-前缀和(2019牛客多校第三场B题)
    [数论]快速幂取模
    [模板]大整数乘法——累加型
    [动态规划] 最大子段和问题
    2073
    17-2-24-D
    17-1-31-C
    2032
    1992
  • 原文地址:https://www.cnblogs.com/energy1010/p/5711434.html
Copyright © 2011-2022 走看看