aboutsummaryrefslogtreecommitdiff
path: root/docs/mllib-clustering.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/mllib-clustering.md')
-rw-r--r--docs/mllib-clustering.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/mllib-clustering.md b/docs/mllib-clustering.md
index 6e46a47338..0b6db4fcb7 100644
--- a/docs/mllib-clustering.md
+++ b/docs/mllib-clustering.md
@@ -314,8 +314,8 @@ val pic = new PowerIteartionClustering()
.setMaxIterations(20)
val model = pic.run(similarities)
-model.assignments.foreach { case (vertexId, clusterId) =>
- println(s"$vertexId -> $clusterId")
+model.assignments.foreach { a =>
+ println(s"${a.id} -> ${a.cluster}")
}
{% endhighlight %}
@@ -349,8 +349,8 @@ PowerIterationClustering pic = new PowerIterationClustering()
.setMaxIterations(10);
PowerIterationClusteringModel model = pic.run(similarities);
-for (Tuple2<Object, Object> assignment: model.assignments().toJavaRDD().collect()) {
- System.out.println(assignment._1() + " -> " + assignment._2());
+for (PowerIterationClustering.Assignment a: model.assignments().toJavaRDD().collect()) {
+ System.out.println(a.id() + " -> " + a.cluster());
}
{% endhighlight %}
</div>