## org.apache.mahout.clustering.topdown.postprocessor
Class ClusterCountReader

    java.lang.Object
      org.apache.mahout.clustering.topdown.postprocessor.ClusterCountReader

    public final class ClusterCountReader

extends Object

Reads the number of clusters produced by the clustering algorithm.

Method Summary
`static Map<Integer,Integer>` `getClusterIDs(org.apache.hadoop.fs.Path clusterOutputPath, org.apache.hadoop.conf.Configuration conf, boolean keyIsClusterId)` Generates a list of all cluster ids by reading the clusters-*-final file.
`static int` `getNumberOfClusters(org.apache.hadoop.fs.Path clusterOutputPath, org.apache.hadoop.conf.Configuration conf)` Reads the number of clusters present by reading the clusters-*-final file.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getNumberOfClusters

    public static int getNumberOfClusters(org.apache.hadoop.fs.Path clusterOutputPath,
                                          org.apache.hadoop.conf.Configuration conf)
                                   throws IOException

  Reads the number of clusters present by reading the clusters-*-final file.

  Parameters:
    `clusterOutputPath` - The output path provided to the clustering algorithm.
    `conf` - The hadoop configuration.
  Returns:
    the number of final clusters.
  Throws:
    `IOException`

### getClusterIDs

    public static Map<Integer,Integer> getClusterIDs(org.apache.hadoop.fs.Path clusterOutputPath,
                                                     org.apache.hadoop.conf.Configuration conf,
                                                     boolean keyIsClusterId)
                                              throws IOException

  Generates a list of all cluster ids by reading the clusters-*-final file.

  Parameters:
    `clusterOutputPath` - The output path provided to the clustering algorithm.
    `conf` - The hadoop configuration.
  Returns:
    An ArrayList containing the final cluster ids.
  Throws:
    `IOException`

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.