Package com.heatonresearch.aifh.kmeans

Examples of com.heatonresearch.aifh.kmeans.KMeans


            }

            final DataSet ds = DataSet.load(istream);
            istream.close();
            final List<BasicData> observations = ds.extractUnsupervisedLabeled(4);
            final KMeans kmeans = new KMeans(3);
            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());
                }
            }
View Full Code Here

TOP

Related Classes of com.heatonresearch.aifh.kmeans.KMeans

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.