org.apache.mahout.clustering.streaming.mapreduce
Class StreamingKMeansReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,CentroidWritable,org.apache.hadoop.io.IntWritable,CentroidWritable>
      extended by org.apache.mahout.clustering.streaming.mapreduce.StreamingKMeansReducer

public class StreamingKMeansReducer
extends org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,CentroidWritable,org.apache.hadoop.io.IntWritable,CentroidWritable>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Constructor Summary
StreamingKMeansReducer()
           
 
Method Summary
static List<Centroid> centroidWritablesToList(Iterable<CentroidWritable> centroids)
           
static Iterable<Vector> getBestCentroids(List<Centroid> centroids, org.apache.hadoop.conf.Configuration conf)
           
 void reduce(org.apache.hadoop.io.IntWritable key, Iterable<CentroidWritable> centroids, org.apache.hadoop.mapreduce.Reducer.Context context)
           
 void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.Reducer
cleanup, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamingKMeansReducer

public StreamingKMeansReducer()
Method Detail

setup

public void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
Overrides:
setup in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,CentroidWritable,org.apache.hadoop.io.IntWritable,CentroidWritable>

reduce

public void reduce(org.apache.hadoop.io.IntWritable key,
                   Iterable<CentroidWritable> centroids,
                   org.apache.hadoop.mapreduce.Reducer.Context context)
            throws IOException,
                   InterruptedException
Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<org.apache.hadoop.io.IntWritable,CentroidWritable,org.apache.hadoop.io.IntWritable,CentroidWritable>
Throws:
IOException
InterruptedException

centroidWritablesToList

public static List<Centroid> centroidWritablesToList(Iterable<CentroidWritable> centroids)

getBestCentroids

public static Iterable<Vector> getBestCentroids(List<Centroid> centroids,
                                                org.apache.hadoop.conf.Configuration conf)


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.