diff options
author | Yanbo Liang <ybliang8@gmail.com> | 2016-05-03 16:46:13 +0200 |
---|---|---|
committer | Nick Pentreath <nickp@za.ibm.com> | 2016-05-03 16:46:13 +0200 |
commit | d26f7cb0121767da678bbbbf3a0e31c63d5e3159 (patch) | |
tree | 76c2dafc74ec093ac832cf5045fbcf10f9e977e7 /python/pyspark/ml/evaluation.py | |
parent | 46965cd014fd4ba68bdec15156ec9bcc27d9b217 (diff) | |
download | spark-d26f7cb0121767da678bbbbf3a0e31c63d5e3159.tar.gz spark-d26f7cb0121767da678bbbbf3a0e31c63d5e3159.tar.bz2 spark-d26f7cb0121767da678bbbbf3a0e31c63d5e3159.zip |
[SPARK-14971][ML][PYSPARK] PySpark ML Params setter code clean up
## What changes were proposed in this pull request?
PySpark ML Params setter code clean up.
For examples,
```setInputCol``` can be simplified from
```
self._set(inputCol=value)
return self
```
to:
```
return self._set(inputCol=value)
```
This is a pretty big sweeps, and we cleaned wherever possible.
## How was this patch tested?
Exist unit tests.
Author: Yanbo Liang <ybliang8@gmail.com>
Closes #12749 from yanboliang/spark-14971.
Diffstat (limited to 'python/pyspark/ml/evaluation.py')
-rw-r--r-- | python/pyspark/ml/evaluation.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/python/pyspark/ml/evaluation.py b/python/pyspark/ml/evaluation.py index 455795f9a0..2a41678741 100644 --- a/python/pyspark/ml/evaluation.py +++ b/python/pyspark/ml/evaluation.py @@ -147,8 +147,7 @@ class BinaryClassificationEvaluator(JavaEvaluator, HasLabelCol, HasRawPrediction """ Sets the value of :py:attr:`metricName`. """ - self._set(metricName=value) - return self + return self._set(metricName=value) @since("1.4.0") def getMetricName(self): @@ -217,8 +216,7 @@ class RegressionEvaluator(JavaEvaluator, HasLabelCol, HasPredictionCol): """ Sets the value of :py:attr:`metricName`. """ - self._set(metricName=value) - return self + return self._set(metricName=value) @since("1.4.0") def getMetricName(self): @@ -284,8 +282,7 @@ class MulticlassClassificationEvaluator(JavaEvaluator, HasLabelCol, HasPredictio """ Sets the value of :py:attr:`metricName`. """ - self._set(metricName=value) - return self + return self._set(metricName=value) @since("1.5.0") def getMetricName(self): |