diff options
author | Zheng RuiFeng <ruifengz@foxmail.com> | 2016-10-25 03:19:50 -0700 |
---|---|---|
committer | Yanbo Liang <ybliang8@gmail.com> | 2016-10-25 03:19:50 -0700 |
commit | 38cdd6ccdaba7f8da985c4f4efe5bd93a46a2b53 (patch) | |
tree | 76412ed76f0d786f6d8a424c5388a3395729e9e0 /mllib/src | |
parent | 6f31833dbe0b766dfe4540a240fe92ebb7e14737 (diff) | |
download | spark-38cdd6ccdaba7f8da985c4f4efe5bd93a46a2b53.tar.gz spark-38cdd6ccdaba7f8da985c4f4efe5bd93a46a2b53.tar.bz2 spark-38cdd6ccdaba7f8da985c4f4efe5bd93a46a2b53.zip |
[SPARK-14634][ML][FOLLOWUP] Delete superfluous line in BisectingKMeans
## What changes were proposed in this pull request?
As commented by jkbradley in https://github.com/apache/spark/pull/12394, `model.setSummary(summary)` is superfluous
## How was this patch tested?
existing tests
Author: Zheng RuiFeng <ruifengz@foxmail.com>
Closes #15619 from zhengruifeng/del_superfluous.
Diffstat (limited to 'mllib/src')
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala | 5 | ||||
-rw-r--r-- | mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala | 6 |
2 files changed, 5 insertions, 6 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala b/mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala index add8ee2a4f..ef2d918ea3 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala @@ -265,9 +265,8 @@ class BisectingKMeans @Since("2.0.0") ( val summary = new BisectingKMeansSummary( model.transform(dataset), $(predictionCol), $(featuresCol), $(k)) model.setSummary(summary) - val m = model.setSummary(summary) - instr.logSuccess(m) - m + instr.logSuccess(model) + model } @Since("2.0.0") diff --git a/mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala b/mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala index b04e82838e..0d2405b500 100644 --- a/mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala +++ b/mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala @@ -324,9 +324,9 @@ class KMeans @Since("1.5.0") ( val model = copyValues(new KMeansModel(uid, parentModel).setParent(this)) val summary = new KMeansSummary( model.transform(dataset), $(predictionCol), $(featuresCol), $(k)) - val m = model.setSummary(summary) - instr.logSuccess(m) - m + model.setSummary(summary) + instr.logSuccess(model) + model } @Since("1.5.0") |