You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by actuaryzhang <gi...@git.apache.org> on 2017/05/13 18:16:42 UTC

[GitHub] spark pull request #17084: [SPARK-18693][ML][MLLIB] ML Evaluators should use...

Github user actuaryzhang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17084#discussion_r116364047
  
    --- 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 --
    
    Check weightCol is double?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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