You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by yl...@apache.org on 2016/10/25 10:19:58 UTC

spark git commit: [SPARK-14634][ML][FOLLOWUP] Delete superfluous line in BisectingKMeans

Repository: spark
Updated Branches:
  refs/heads/master 6f31833db -> 38cdd6ccd


[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 <ru...@foxmail.com>

Closes #15619 from zhengruifeng/del_superfluous.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/38cdd6cc
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/38cdd6cc
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/38cdd6cc

Branch: refs/heads/master
Commit: 38cdd6ccdaba7f8da985c4f4efe5bd93a46a2b53
Parents: 6f31833
Author: Zheng RuiFeng <ru...@foxmail.com>
Authored: Tue Oct 25 03:19:50 2016 -0700
Committer: Yanbo Liang <yb...@gmail.com>
Committed: Tue Oct 25 03:19:50 2016 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/clustering/BisectingKMeans.scala | 5 ++---
 .../src/main/scala/org/apache/spark/ml/clustering/KMeans.scala | 6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/38cdd6cc/mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala
----------------------------------------------------------------------
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 add8ee2..ef2d918 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")

http://git-wip-us.apache.org/repos/asf/spark/blob/38cdd6cc/mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala
----------------------------------------------------------------------
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 b04e828..0d2405b 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")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org