## org.apache.mahout.cf.taste.hadoop.item
Class AggregateAndRecommendReducer

    java.lang.Object
      org.apache.hadoop.mapreduce.Reducer<VarLongWritable,PrefAndSimilarityColumnWritable,VarLongWritable,RecommendedItemsWritable>
          org.apache.mahout.cf.taste.hadoop.item.AggregateAndRecommendReducer

    public final class AggregateAndRecommendReducer

extends org.apache.hadoop.mapreduce.Reducer<VarLongWritable,PrefAndSimilarityColumnWritable,VarLongWritable,RecommendedItemsWritable>

computes prediction values for each user

     u = a user
     i = an item not yet rated by u
     N = all items similar to i (where similarity is usually computed by pairwisely comparing the item-vectors
     of the user-item matrix)

     Prediction(u,i) = sum(all n from N: similarity(i,n) * rating(u,n)) / sum(all n from N: abs(similarity(i,n)))

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.hadoop.mapreduce.Reducer
`org.apache.hadoop.mapreduce.Reducer.Context`

Constructor Summary
`AggregateAndRecommendReducer()`

Method Summary
`protected void` `reduce(VarLongWritable userID, Iterable<PrefAndSimilarityColumnWritable> values, org.apache.hadoop.mapreduce.Reducer.Context context)`
`protected 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

### AggregateAndRecommendReducer

    public AggregateAndRecommendReducer()

Method Detail

### setup

    protected void setup(org.apache.hadoop.mapreduce.Reducer.Context context)
                  throws IOException

  Overrides:
    `setup` in class `org.apache.hadoop.mapreduce.Reducer<VarLongWritable,PrefAndSimilarityColumnWritable,VarLongWritable,RecommendedItemsWritable>`
  Throws:
    `IOException`

### reduce

    protected void reduce(VarLongWritable userID,
                          Iterable<PrefAndSimilarityColumnWritable> values,
                          org.apache.hadoop.mapreduce.Reducer.Context context)
                   throws IOException,
                          InterruptedException

  Overrides:
    `reduce` in class `org.apache.hadoop.mapreduce.Reducer<VarLongWritable,PrefAndSimilarityColumnWritable,VarLongWritable,RecommendedItemsWritable>`
  Throws:
    `IOException`
    `InterruptedException`

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