org.apache.mahout.clustering
Class ClusterIterator
java.lang.Object
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.
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 |
ClusterIterator
public ClusterIterator(ClusteringPolicy policy)
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 vectorsclassifier
- a prior ClusterClassifiernumIterations
- 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 VectorWritablespriorPath
- a Path to the prior classifieroutPath
- a Path of output directorynumIterations
- the int number of iterations to perform
- Throws:
IOException
Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.