|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mahout.clustering.streaming.mapreduce.StreamingKMeansUtilsMR
public final class StreamingKMeansUtilsMR
| Method Summary | |
|---|---|
static Iterable<Centroid> |
castVectorsToCentroids(Iterable<Vector> input)
Returns an Iterable of Centroid from an Iterable of Vector by either casting each Vector to Centroid (if the instance extends Centroid) or create a new Centroid based on that Vector. |
static Iterable<Centroid> |
getCentroidsFromVectorWritable(Iterable<VectorWritable> inputIterable)
Returns an Iterable of centroids from an Iterable of VectorWritables by creating a new Centroid containing a RandomAccessSparseVector as a delegate for each VectorWritable. |
static UpdatableSearcher |
searcherFromConfiguration(org.apache.hadoop.conf.Configuration conf)
Instantiates a searcher from a given configuration. |
static void |
writeCentroidsToSequenceFile(Iterable<Centroid> centroids,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
Writes centroids to a sequence file. |
static void |
writeVectorsToSequenceFile(Iterable<? extends Vector> datapoints,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static UpdatableSearcher searcherFromConfiguration(org.apache.hadoop.conf.Configuration conf)
conf - the configuration
RuntimeException - if the distance measure class cannot be instantiated
IllegalStateException - if an unknown searcher class was requestedpublic static Iterable<Centroid> getCentroidsFromVectorWritable(Iterable<VectorWritable> inputIterable)
inputIterable - VectorWritable Iterable to get Centroids from
public static Iterable<Centroid> castVectorsToCentroids(Iterable<Vector> input)
input - Iterable of Vectors to cast
public static void writeCentroidsToSequenceFile(Iterable<Centroid> centroids,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
throws IOException
centroids - the centroids to write.path - the path of the output file.conf - the configuration for the HDFS to write the file to.
IOException
public static void writeVectorsToSequenceFile(Iterable<? extends Vector> datapoints,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf)
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||