Github user MLnick commented on a diff in the pull request:
https://github.com/apache/spark/pull/18390#discussion_r123976350
--- 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 --
It may make sense to split these into 2 (i.e. the weighted options and the
label options) and move them into the companion object. That they can be used
for validation here and in the consistency checks in `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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]