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

    https://github.com/apache/spark/pull/17995#discussion_r125605206
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala
 ---
    @@ -83,19 +85,16 @@ class BinaryClassificationEvaluator @Since("1.4.0") 
(@Since("1.4.0") override va
             case Row(rawPrediction: Double, label: Double) => (rawPrediction, 
label)
           }
         val metrics = new BinaryClassificationMetrics(scoreAndLabels)
    -    val metric = $(metricName) match {
    -      case "areaUnderROC" => metrics.areaUnderROC()
    -      case "areaUnderPR" => metrics.areaUnderPR()
    +    val metric = Param.findStringOption(supportedMetricNames, 
getMetricName) match {
    +      case AreaUnderROC => metrics.areaUnderROC()
    +      case AreaUnderPR => metrics.areaUnderPR()
         }
         metrics.unpersist()
         metric
       }
     
       @Since("1.5.0")
    -  override def isLargerBetter: Boolean = $(metricName) match {
    -    case "areaUnderROC" => true
    -    case "areaUnderPR" => true
    -  }
    +  override def isLargerBetter: Boolean = true
    --- End diff --
    
    It's better to keep the original style, since we may add new metric which 
is not comply with ```isLargerBetter```.


---
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