Example usage for org.apache.mahout.clustering Cluster FINAL_ITERATION_SUFFIX

List of usage examples for org.apache.mahout.clustering Cluster FINAL_ITERATION_SUFFIX

Introduction

In this page you can find the example usage for org.apache.mahout.clustering Cluster FINAL_ITERATION_SUFFIX.

Prototype

String FINAL_ITERATION_SUFFIX

To view the source code for org.apache.mahout.clustering Cluster FINAL_ITERATION_SUFFIX.

Click Source Link

Usage

From source file:sigis.kmeansmultiplek.AnotherKmeans.java

private void readAndPrintOutputValues(final Configuration configuration) throws IOException {
    final Path input = new Path(OUTPUT_PATH + "/" + Cluster.CLUSTERED_POINTS_DIR + "/part-m-00000");
    //final Path input = new Path(OUTPUT_PATH + "/" + Cluster.FINAL_ITERATION_SUFFIX + "/part-r-00000");
    System.out.println(Cluster.FINAL_ITERATION_SUFFIX);
    System.out.println(Cluster.CLUSTERED_POINTS_DIR);

    final SequenceFile.Reader reader = new SequenceFile.Reader(configuration, SequenceFile.Reader.file(input));

    final IntWritable key = new IntWritable();
    final WeightedPropertyVectorWritable value = new WeightedPropertyVectorWritable();

    while (reader.next(key, value)) {
        LOG.info("{} belongs to cluster {}", value.toString(), key.toString());
        System.out.println(value.toString().substring(18, 28));
        LOG.info("belongs to cluster {}", key.toString());

    }//w  w  w  . j  a  v a  2 s.c  o m
    reader.close();
}

From source file:sigis.pighout.CanopyCluster.java

private void writeInitialCentroidsCanopy(final Configuration conf, String POINTS_PATH, String CLUSTER_PATH)
        throws IOException, InterruptedException, ClassNotFoundException {

    CanopyDriver.run(new Path(POINTS_PATH), new Path(CLUSTER_PATH), new EuclideanDistanceMeasure(), (float) 3.1,
            (float) 2.1, false, 0.5, false);

    System.out.println(Cluster.FINAL_ITERATION_SUFFIX);
    System.out.println(Cluster.CLUSTERED_POINTS_DIR);
}