srowen commented on a change in pull request #23589: [SPARK-26351][mllib]Update 
doc and minor correction in the mllib evaluation metrics
URL: https://github.com/apache/spark/pull/23589#discussion_r249248509
 
 

 ##########
 File path: 
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala
 ##########
 @@ -100,7 +100,7 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: 
RDD[(Array[T], Array[T])]
           }
           i += 1
         }
-        precSum / labSet.size
+        precSum / n
 
 Review comment:
   According to the definition linked to in wikipedia, the divisor should be 
the total number of relevant documents, which is labSet.size, or |D_i| above. 
Unless I'm missing an argument about why it has to be different, I think we 
should keep this and not change its answers, but update the formula in the docs.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to