org.apache.mahout.math.hadoop
Class MatrixColumnMeansJob.MatrixColumnMeansMapper

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Writable,VectorWritable,org.apache.hadoop.io.NullWritable,VectorWritable>
      extended by org.apache.mahout.math.hadoop.MatrixColumnMeansJob.MatrixColumnMeansMapper
Enclosing class:
MatrixColumnMeansJob

public static class MatrixColumnMeansJob.MatrixColumnMeansMapper
extends org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Writable,VectorWritable,org.apache.hadoop.io.NullWritable,VectorWritable>

Mapper for calculation of column-wise mean.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Mapper
org.apache.hadoop.mapreduce.Mapper.Context
 
Constructor Summary
MatrixColumnMeansJob.MatrixColumnMeansMapper()
           
 
Method Summary
 void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
          The column-wise sum is written at the cleanup stage.
 void map(org.apache.hadoop.io.Writable r, VectorWritable v, org.apache.hadoop.mapreduce.Mapper.Context context)
          The mapper computes a running sum of the vectors the task has seen.
 void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.Mapper
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixColumnMeansJob.MatrixColumnMeansMapper

public MatrixColumnMeansJob.MatrixColumnMeansMapper()
Method Detail

setup

public void setup(org.apache.hadoop.mapreduce.Mapper.Context context)
Overrides:
setup in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Writable,VectorWritable,org.apache.hadoop.io.NullWritable,VectorWritable>

map

public void map(org.apache.hadoop.io.Writable r,
                VectorWritable v,
                org.apache.hadoop.mapreduce.Mapper.Context context)
         throws IOException
The mapper computes a running sum of the vectors the task has seen. Element 0 of the running sum vector contains a count of the number of vectors that have been seen. The remaining elements contain the column-wise running sum. Nothing is written at this stage

Overrides:
map in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Writable,VectorWritable,org.apache.hadoop.io.NullWritable,VectorWritable>
Throws:
IOException

cleanup

public void cleanup(org.apache.hadoop.mapreduce.Mapper.Context context)
             throws InterruptedException,
                    IOException
The column-wise sum is written at the cleanup stage. A single reducer is forced so null can be used for the key

Overrides:
cleanup in class org.apache.hadoop.mapreduce.Mapper<org.apache.hadoop.io.Writable,VectorWritable,org.apache.hadoop.io.NullWritable,VectorWritable>
Throws:
InterruptedException
IOException


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