We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea6c285 commit 2f4c2a5Copy full SHA for 2f4c2a5
examples/src/main/scala/org/apache/spark/examples/mllib/BisectingKMeansExample.scala
@@ -36,6 +36,7 @@ object BisectingKMeansExample {
36
val sparkConf = new SparkConf().setAppName("mllib.BisectingKMeansExample")
37
val sc = new SparkContext(sparkConf)
38
39
+ // $example on$
40
// Loads and parses data
41
def parse(line: String): Vector = Vectors.dense(line.split(" ").map(_.toDouble))
42
val data = sc.textFile("data/mllib/kmeans_data.txt").map(parse).cache()
@@ -49,6 +50,7 @@ object BisectingKMeansExample {
49
50
model.clusterCenters.zipWithIndex.foreach { case (center, idx) =>
51
println(s"Cluster Center ${idx}: ${center}")
52
}
53
+ // $example off$
54
55
sc.stop()
56
0 commit comments