Skip to content

Commit 2f4c2a5

Browse files
committed
Add $example on$ and $example off$ to the example code
1 parent ea6c285 commit 2f4c2a5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

examples/src/main/scala/org/apache/spark/examples/mllib/BisectingKMeansExample.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ object BisectingKMeansExample {
3636
val sparkConf = new SparkConf().setAppName("mllib.BisectingKMeansExample")
3737
val sc = new SparkContext(sparkConf)
3838

39+
// $example on$
3940
// Loads and parses data
4041
def parse(line: String): Vector = Vectors.dense(line.split(" ").map(_.toDouble))
4142
val data = sc.textFile("data/mllib/kmeans_data.txt").map(parse).cache()
@@ -49,6 +50,7 @@ object BisectingKMeansExample {
4950
model.clusterCenters.zipWithIndex.foreach { case (center, idx) =>
5051
println(s"Cluster Center ${idx}: ${center}")
5152
}
53+
// $example off$
5254

5355
sc.stop()
5456
}

0 commit comments

Comments
 (0)