List of usage examples for org.apache.mahout.clustering.streaming.mapreduce CentroidWritable getCentroid
public Centroid getCentroid()
From source file:org.conan.mymahout.clustering.streaming.tools.IOUtils.java
License:Apache License
/** * Converts CentroidWritable values in a sequence file into Centroids lazily. * @param dirIterable the source iterable (comes from a SequenceFileDirIterable). * @return an Iterable<Centroid> with the converted vectors. *//*from w ww .j av a 2 s.com*/ public static Iterable<Centroid> getCentroidsFromCentroidWritableIterable( Iterable<CentroidWritable> dirIterable) { return Iterables.transform(dirIterable, new Function<CentroidWritable, Centroid>() { @Override public Centroid apply(CentroidWritable input) { Preconditions.checkNotNull(input); return input.getCentroid().clone(); } }); }