org.apache.mahout.cf.taste.hadoop.item
Class ItemFilterAsVectorAndPrefsReducer

java.lang.Object
  extended by org.apache.hadoop.mapreduce.Reducer<VarLongWritable,VarLongWritable,VarIntWritable,VectorAndPrefsWritable>
      extended by org.apache.mahout.cf.taste.hadoop.item.ItemFilterAsVectorAndPrefsReducer

public class ItemFilterAsVectorAndPrefsReducer
extends org.apache.hadoop.mapreduce.Reducer<VarLongWritable,VarLongWritable,VarIntWritable,VectorAndPrefsWritable>

we use a neat little trick to explicitly filter items for some users: we inject a NaN summand into the preference estimation for those items, which makes AggregateAndRecommendReducer automatically exclude them


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
org.apache.hadoop.mapreduce.Reducer.Context
 
Constructor Summary
ItemFilterAsVectorAndPrefsReducer()
           
 
Method Summary
protected  void reduce(VarLongWritable itemID, Iterable<VarLongWritable> values, org.apache.hadoop.mapreduce.Reducer.Context ctx)
           
 
Methods inherited from class org.apache.hadoop.mapreduce.Reducer
cleanup, run, setup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemFilterAsVectorAndPrefsReducer

public ItemFilterAsVectorAndPrefsReducer()
Method Detail

reduce

protected void reduce(VarLongWritable itemID,
                      Iterable<VarLongWritable> values,
                      org.apache.hadoop.mapreduce.Reducer.Context ctx)
               throws IOException,
                      InterruptedException
Overrides:
reduce in class org.apache.hadoop.mapreduce.Reducer<VarLongWritable,VarLongWritable,VarIntWritable,VectorAndPrefsWritable>
Throws:
IOException
InterruptedException


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