org.apache.mahout.clustering
Class ClusterIterator

java.lang.Object
  extended by org.apache.mahout.clustering.ClusterIterator

public class ClusterIterator
extends Object

This is an experimental clustering iterator which works with a ClusteringPolicy and a prior ClusterClassifier which has been initialized with a set of models. To date, it has been tested with k-means and Dirichlet clustering. See examples DisplayKMeans and DisplayDirichlet which have been switched over to use it.


Constructor Summary
ClusterIterator(ClusteringPolicy policy)
           
 
Method Summary
 ClusterClassifier iterate(Iterable<Vector> data, ClusterClassifier classifier, int numIterations)
          Iterate over data using a prior-trained ClusterClassifier, for a number of iterations
 void iterate(org.apache.hadoop.fs.Path inPath, org.apache.hadoop.fs.Path priorPath, org.apache.hadoop.fs.Path outPath, int numIterations)
          Iterate over data using a prior-trained ClusterClassifier, for a number of iterations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterIterator

public ClusterIterator(ClusteringPolicy policy)
Method Detail

iterate

public ClusterClassifier iterate(Iterable<Vector> data,
                                 ClusterClassifier classifier,
                                 int numIterations)
Iterate over data using a prior-trained ClusterClassifier, for a number of iterations

Parameters:
data - a List<Vector> of input vectors
classifier - a prior ClusterClassifier
numIterations - the int number of iterations to perform
Returns:
the posterior ClusterClassifier

iterate

public void iterate(org.apache.hadoop.fs.Path inPath,
                    org.apache.hadoop.fs.Path priorPath,
                    org.apache.hadoop.fs.Path outPath,
                    int numIterations)
             throws IOException
Iterate over data using a prior-trained ClusterClassifier, for a number of iterations

Parameters:
inPath - a Path to input VectorWritables
priorPath - a Path to the prior classifier
outPath - a Path of output directory
numIterations - the int number of iterations to perform
Throws:
IOException


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.