|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mahout.clustering.ClusterIterator
public class ClusterIterator
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 |
static void |
iterateMR(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 using a mapreduce implementation |
void |
iterateSeq(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 using a sequential implementation |
static ClusterClassifier |
readClassifier(org.apache.hadoop.fs.Path inPath)
|
static void |
writeClassifier(ClusterClassifier classifier,
org.apache.hadoop.fs.Path outPath,
String k)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClusterIterator(ClusteringPolicy policy)
| Method Detail |
|---|
public ClusterClassifier iterate(Iterable<Vector> data,
ClusterClassifier classifier,
int numIterations)
data - a List<Vector> of input vectorsclassifier - a prior ClusterClassifiernumIterations - the int number of iterations to perform
public void iterateSeq(org.apache.hadoop.fs.Path inPath,
org.apache.hadoop.fs.Path priorPath,
org.apache.hadoop.fs.Path outPath,
int numIterations)
throws IOException
inPath - a Path to input VectorWritablespriorPath - a Path to the prior classifieroutPath - a Path of output directorynumIterations - the int number of iterations to perform
IOException
public static void iterateMR(org.apache.hadoop.fs.Path inPath,
org.apache.hadoop.fs.Path priorPath,
org.apache.hadoop.fs.Path outPath,
int numIterations)
throws IOException,
InterruptedException,
ClassNotFoundException
inPath - a Path to input VectorWritablespriorPath - a Path to the prior classifieroutPath - a Path of output directorynumIterations - the int number of iterations to perform
IOException
InterruptedException
ClassNotFoundException
public static void writeClassifier(ClusterClassifier classifier,
org.apache.hadoop.fs.Path outPath,
String k)
throws IOException
IOException
public static ClusterClassifier readClassifier(org.apache.hadoop.fs.Path inPath)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||