kmeans.initForgy(observations);
final int iterations = kmeans.iteration(1000);
System.out.println("Finished after " + iterations + " iterations.");
for (int i = 0; i < kmeans.getK(); i++) {
final Cluster cluster = kmeans.getClusters().get(i);
System.out.println("* * * Cluster #" + i);
for (final BasicData d : cluster.getObservations()) {
System.out.println(d.toString());
}
}
} catch (Exception ex) {
ex.printStackTrace();