uchiiii commented on code in PR #36920:
URL: https://github.com/apache/spark/pull/36920#discussion_r903171942


##########
mllib/src/main/scala/org/apache/spark/mllib/evaluation/RankingMetrics.scala:
##########
@@ -38,16 +38,14 @@ import org.apache.spark.rdd.RDD
  *                            Since 3.4.0, it supports ndcg evaluation with 
relevance value.
  */
 @Since("1.2.0")
-class RankingMetrics[T: ClassTag] @Since("3.4.0") (
-    predictionAndLabels: RDD[(Array[T], Array[T], Array[Double])])
+class RankingMetrics[T: ClassTag] @Since("1.2.0") (predictionAndLabels: RDD[_ 
<: Product])
     extends Logging
     with Serializable {
 
-  @Since("1.2.0")
-  def this(predictionAndLabelsWithoutRelevance: => RDD[(Array[T], Array[T])]) 
= {
-    this(predictionAndLabelsWithoutRelevance.map {
-      case (pred, lab) => (pred, lab, Array.empty[Double])
-    })
+  private val rdd = predictionAndLabels.map {

Review Comment:
   We may want not to change the name because 
   - `MulticlassMetrics` also has the arguments whose name is 
`predictionAndLabels`.
   
https://github.com/apache/spark/blob/b588d070ebc234280af730c8f9915e8859b1886e/mllib/src/main/scala/org/apache/spark/mllib/evaluation/MulticlassMetrics.scala#L28-L35
   - We change the interface of the constructor to be able to support more 
inputs. Specific names like `predictionAndLabelsWithOptionalRelevance` may go 
against the goal.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to