Github user imatiach-msft commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17084#discussion_r123925177
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala
 ---
    @@ -77,12 +87,16 @@ class BinaryClassificationEvaluator @Since("1.4.0") 
(@Since("1.4.0") override va
         SchemaUtils.checkNumericType(schema, $(labelCol))
     
         // TODO: When dataset metadata has been implemented, check 
rawPredictionCol vector length = 2.
    -    val scoreAndLabels =
    -      dataset.select(col($(rawPredictionCol)), 
col($(labelCol)).cast(DoubleType)).rdd.map {
    -        case Row(rawPrediction: Vector, label: Double) => 
(rawPrediction(1), label)
    -        case Row(rawPrediction: Double, label: Double) => (rawPrediction, 
label)
    +    val scoreAndLabelsWithWeights =
    +      dataset.select(col($(rawPredictionCol)), 
col($(labelCol)).cast(DoubleType),
    +        if (!isDefined(weightCol) || $(weightCol).isEmpty) lit(1.0) else 
col($(weightCol)))
    --- End diff --
    
    added check for numeric type and did cast to Double, similar to labelCol


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to