Github user rawataaryan9 commented on a diff in the pull request: https://github.com/apache/spark/pull/18390#discussion_r124508673 --- Diff: mllib/src/main/scala/org/apache/spark/ml/evaluation/MulticlassClassificationEvaluator.scala --- @@ -39,19 +39,35 @@ class MulticlassClassificationEvaluator @Since("1.5.0") (@Since("1.5.0") overrid def this() = this(Identifiable.randomUID("mcEval")) /** + * param for specific label value for metric to be used in evaluation (supports + * Double values for metric `"f1"`, `"precision"`, `"recall"`, `"tpr"`, `"fpr"`) + * @group param + */ + val labelValue: Param[Double] = { + new DoubleParam(this, "labelValue", "specific labelValue for metric to be used in evaluation") + } + + /** * param for metric name in evaluation (supports `"f1"` (default), `"weightedPrecision"`, - * `"weightedRecall"`, `"accuracy"`) + * `"weightedRecall"`, `"accuracy"` and with labelValue `"f1"`, `"precision"`, `"recall"`, + * `"tpr"`, `"fpr"`) * @group param */ @Since("1.5.0") val metricName: Param[String] = { - val allowedParams = ParamValidators.inArray(Array("f1", "weightedPrecision", - "weightedRecall", "accuracy")) + val allowedParams = ParamValidators.inArray(Array("f1", "weightedPrecision", "weightedRecall", --- End diff -- Added consistency checks in both initialization and evaluate.
--- 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