srowen commented on a change in pull request #24868: [SPARK-28044][ML][PYTHON]
MulticlassClassificationEvaluator support more metrics
URL: https://github.com/apache/spark/pull/24868#discussion_r294342082
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/evaluation/MulticlassClassificationEvaluator.scala
##########
@@ -72,7 +73,39 @@ class MulticlassClassificationEvaluator @Since("1.5.0")
(@Since("1.5.0") overrid
@Since("3.0.0")
def setWeightCol(value: String): this.type = set(weightCol, value)
- setDefault(metricName -> "f1")
+ @Since("3.0.0")
+ final val metricLabel: DoubleParam = new DoubleParam(this, "metricLabel",
+ "The class whose metric will be computed in truePositiveRateByLabel|" +
Review comment:
Do you want to introduce a list of valid metrics to validate against like is
done with supportedMetricNames? maybe it's just `supportedMetricNames.map(_ +
"ByLabel")` even? You can put this whole `DoubleParam` declaration in a block
to introduce intermediate variables if that's easier.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]