spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: Clean up SparkKMeans example's code
Date Thu, 10 Jul 2014 06:45:25 GMT
Repository: spark
Updated Branches:
  refs/heads/master 553c578de -> 2b18ea982


Clean up SparkKMeans example's code

remove unused code

Author: Raymond Liu <raymond.liu@intel.com>

Closes #1352 from colorant/kmeans and squashes the following commits:

ddcd1dd [Raymond Liu] Clean up SparkKMeans example's code


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

Branch: refs/heads/master
Commit: 2b18ea9826395177ac2203dbf8eb37c220ab8e67
Parents: 553c578
Author: Raymond Liu <raymond.liu@intel.com>
Authored: Wed Jul 9 23:39:29 2014 -0700
Committer: Reynold Xin <rxin@apache.org>
Committed: Wed Jul 9 23:39:29 2014 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/examples/SparkKMeans.scala  | 5 -----
 1 file changed, 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/2b18ea98/examples/src/main/scala/org/apache/spark/examples/SparkKMeans.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/spark/examples/SparkKMeans.scala b/examples/src/main/scala/org/apache/spark/examples/SparkKMeans.scala
index 4d28e0a..79cfedf 100644
--- a/examples/src/main/scala/org/apache/spark/examples/SparkKMeans.scala
+++ b/examples/src/main/scala/org/apache/spark/examples/SparkKMeans.scala
@@ -17,8 +17,6 @@
 
 package org.apache.spark.examples
 
-import java.util.Random
-
 import breeze.linalg.{Vector, DenseVector, squaredDistance}
 
 import org.apache.spark.{SparkConf, SparkContext}
@@ -28,15 +26,12 @@ import org.apache.spark.SparkContext._
  * K-means clustering.
  */
 object SparkKMeans {
-  val R = 1000     // Scaling factor
-  val rand = new Random(42)
 
   def parseVector(line: String): Vector[Double] = {
     DenseVector(line.split(' ').map(_.toDouble))
   }
 
   def closestPoint(p: Vector[Double], centers: Array[Vector[Double]]): Int = {
-    var index = 0
     var bestIndex = 0
     var closest = Double.PositiveInfinity
 


Mime
View raw message