Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Commit 2f96242

Browse files
committed
[MINOR][ML] Remove unnecessary default value setting for evaluators.
## What changes were proposed in this pull request? Remove unnecessary default value setting for all evaluators, as we have set them in corresponding _HasXXX_ base classes. ## How was this patch tested? Existing tests. Author: Yanbo Liang <[email protected]> Closes apache#19262 from yanboliang/evaluation.
1 parent 8319432 commit 2f96242

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

python/pyspark/ml/evaluation.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ def __init__(self, rawPredictionCol="rawPrediction", labelCol="label",
146146
super(BinaryClassificationEvaluator, self).__init__()
147147
self._java_obj = self._new_java_obj(
148148
"org.apache.spark.ml.evaluation.BinaryClassificationEvaluator", self.uid)
149-
self._setDefault(rawPredictionCol="rawPrediction", labelCol="label",
150-
metricName="areaUnderROC")
149+
self._setDefault(metricName="areaUnderROC")
151150
kwargs = self._input_kwargs
152151
self._set(**kwargs)
153152

@@ -224,8 +223,7 @@ def __init__(self, predictionCol="prediction", labelCol="label",
224223
super(RegressionEvaluator, self).__init__()
225224
self._java_obj = self._new_java_obj(
226225
"org.apache.spark.ml.evaluation.RegressionEvaluator", self.uid)
227-
self._setDefault(predictionCol="prediction", labelCol="label",
228-
metricName="rmse")
226+
self._setDefault(metricName="rmse")
229227
kwargs = self._input_kwargs
230228
self._set(**kwargs)
231229

@@ -297,8 +295,7 @@ def __init__(self, predictionCol="prediction", labelCol="label",
297295
super(MulticlassClassificationEvaluator, self).__init__()
298296
self._java_obj = self._new_java_obj(
299297
"org.apache.spark.ml.evaluation.MulticlassClassificationEvaluator", self.uid)
300-
self._setDefault(predictionCol="prediction", labelCol="label",
301-
metricName="f1")
298+
self._setDefault(metricName="f1")
302299
kwargs = self._input_kwargs
303300
self._set(**kwargs)
304301

0 commit comments

Comments
 (0)