Skip to content
Closed
Prev Previous commit
Next Next commit
Example code for Power Iteration Clustering
  • Loading branch information
shahidki31 committed Jun 7, 2018
commit adb28aae1995bf2e00b273bc9112fd0a75b71eb5
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public static void main(String[] args) {
.setK(2)
.setMaxIter(10);

Dataset<Row> result = pic.transform(df).select("id", "prediction");
Dataset<Row> result = pic.transform(df);

// printing results
System.out.println("Clustering results [id , cluster]");
for (Row row : result.collectAsList()) {
for (Row row : result.select("id","prediction").collectAsList()) {
System.out.println("[" + row.get(0) + " , " + row.get(1) + "]");
}

Expand Down