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_r294342741
 
 

 ##########
 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|" +
+      
"falsePositiveRateByLabel|precisionByLabel|recallByLabel|fMeasureByLabel." +
+      " Must be >= 0. The default value is 0.",
+    ParamValidators.gtEq(0.0))
+
+  /** @group getParam */
+  @Since("3.0.0")
+  def getMetricLabel: Double = $(metricLabel)
+
+  /** @group setParam */
+  @Since("3.0.0")
+  def setMetricLabel(value: Double): this.type = set(metricLabel, value)
+
+  setDefault(metricLabel -> 0.0)
+
+  @Since("3.0.0")
+  final val beta: DoubleParam = new DoubleParam(this, "beta",
+    "The beta value used in weightedFMeasure|fMeasureByLabel." +
 
 Review comment:
   I know what this is, but I'd put a tiny bit more hint about it in the 
description, like "The beta value, which controls precision vs recall 
weighting, used in ..."

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

Reply via email to