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

    https://github.com/apache/spark/pull/18390#discussion_r123976066
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/evaluation/MulticlassClassificationEvaluator.scala
 ---
    @@ -80,11 +97,22 @@ class MulticlassClassificationEvaluator @Since("1.5.0") 
(@Since("1.5.0") overrid
             case Row(prediction: Double, label: Double) => (prediction, label)
           }
         val metrics = new MulticlassMetrics(predictionAndLabels)
    -    val metric = $(metricName) match {
    -      case "f1" => metrics.weightedFMeasure
    -      case "weightedPrecision" => metrics.weightedPrecision
    -      case "weightedRecall" => metrics.weightedRecall
    -      case "accuracy" => metrics.accuracy
    +    val labelVal = getLabelValue
    --- End diff --
    
    The errors thrown here will end up being quite cryptic - `MatchError` will 
be thrown. It would be better to do some checks on consistency of the metric 
and label value, and throw with a more specific error message.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to