srowen commented on code in PR #36843:
URL: https://github.com/apache/spark/pull/36843#discussion_r896243825


##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -35,8 +35,16 @@ import org.apache.spark.rdd.RDD
  * @param predictionAndLabels an RDD of (predicted ranking, ground truth set) 
pairs.
  */
 @Since("1.2.0")
-class RankingMetrics[T: ClassTag](predictionAndLabels: RDD[(Array[T], 
Array[T])])
-  extends Logging with Serializable {
+class RankingMetrics[T: ClassTag](
+    predictionAndLabels: RDD[(Array[T], Array[T], Array[(T, Double)])])

Review Comment:
   Hm, why does the last need to be (T, Double) pairs? Wouldn't this be an 
attribute of the ground truth? Looking this up via Map seems clunky later. The 
problem is not changing the binary signature, but, at least, how about a third 
array of Double only, that is parallel to the second array?



##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -58,9 +66,12 @@ class RankingMetrics[T: ClassTag](predictionAndLabels: 
RDD[(Array[T], Array[T])]
   @Since("1.2.0")
   def precisionAt(k: Int): Double = {

Review Comment:
   Is there any similar notion of precision@k when the ground truth has a 
relevance 'weight'?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to