Github user yanboliang commented on a diff in the pull request: https://github.com/apache/spark/pull/17995#discussion_r123888757 --- Diff: mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala --- @@ -46,11 +48,10 @@ class BinaryClassificationEvaluator @Since("1.4.0") (@Since("1.4.0") override va * @group param */ @Since("1.2.0") - val metricName: Param[String] = { - val allowedParams = ParamValidators.inArray(Array("areaUnderROC", "areaUnderPR")) - new Param( - this, "metricName", "metric name in evaluation (areaUnderROC|areaUnderPR)", allowedParams) - } + val metricName: Param[String] = new Param[String](this, "metricName", "metric name in" + + " evaluation (areaUnderROC|areaUnderPR)", + (value: String) => Array("areaunderroc", "areaunderpr").contains( + value.toLowerCase(Locale.ROOT))) --- End diff -- Could we organize as ``` val AreaUnderROC: String = "areaUnderROC".toLowerCase val AreaUnderPR: String = "areaUnderPR".toLowerCase val supportedMetricNames = Set(AreaUnderROC, AreaUnderPR) ``` in ```object BinaryClassificationEvaluator```? This should be more clear.
--- 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