Skip to content

Commit f82ebb1

Browse files
BenFradetjkbradley
authored andcommitted
[SPARK-12368][ML][DOC] Better doc for the binary classification evaluator' metricName
For the BinaryClassificationEvaluator, the scaladoc doesn't mention that "areaUnderPR" is supported, only that the default is "areadUnderROC". Also, in the documentation, it is said that: "The default metric used to choose the best ParamMap can be overriden by the setMetric method in each of these evaluators." However, the method is called setMetricName. This PR aims to fix both issues. Author: BenFradet <[email protected]> Closes apache#10328 from BenFradet/SPARK-12368.
1 parent fcd013c commit f82ebb1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

docs/ml-guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ Currently, `spark.ml` supports model selection using the [`CrossValidator`](api/
628628
The `Evaluator` can be a [`RegressionEvaluator`](api/scala/index.html#org.apache.spark.ml.evaluation.RegressionEvaluator)
629629
for regression problems, a [`BinaryClassificationEvaluator`](api/scala/index.html#org.apache.spark.ml.evaluation.BinaryClassificationEvaluator)
630630
for binary data, or a [`MultiClassClassificationEvaluator`](api/scala/index.html#org.apache.spark.ml.evaluation.MultiClassClassificationEvaluator)
631-
for multiclass problems. The default metric used to choose the best `ParamMap` can be overriden by the `setMetric`
631+
for multiclass problems. The default metric used to choose the best `ParamMap` can be overriden by the `setMetricName`
632632
method in each of these evaluators.
633633

634634
The `ParamMap` which produces the best evaluation metric (averaged over the `$k$` folds) is selected as the best model.
@@ -951,4 +951,4 @@ model.transform(test)
951951
{% endhighlight %}
952952
</div>
953953

954-
</div>
954+
</div>

mllib/src/main/scala/org/apache/spark/ml/evaluation/BinaryClassificationEvaluator.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ class BinaryClassificationEvaluator @Since("1.4.0") (@Since("1.4.0") override va
3939
def this() = this(Identifiable.randomUID("binEval"))
4040

4141
/**
42-
* param for metric name in evaluation
43-
* Default: areaUnderROC
42+
* param for metric name in evaluation (supports `"areaUnderROC"` (default), `"areaUnderPR"`)
4443
* @group param
4544
*/
4645
@Since("1.2.0")

0 commit comments

Comments
 (0)