Skip to content
Snippets Groups Projects
Commit 2b18ea98 authored by Raymond Liu's avatar Raymond Liu Committed by Reynold Xin
Browse files

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
parent 553c578d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment