本文主要是介绍向MapReduce转换:形成推荐,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<strong><span style="font-size:18px;">/**** @author YangXin* @info 向MapReduce转换:形成推荐 ,处理来自向量的推荐结果。*/
package unitSix;import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;import org.apache.hadoop.mapreduce.Reducer;
import org.apache.mahout.cf.taste.hadoop.RecommendedItemsWritable;
import org.apache.mahout.cf.taste.impl.recommender.ByValueRecommendedItemComparator;
import org.apache.mahout.cf.taste.impl.recommender.GenericRecommendedItem;
import org.apache.mahout.cf.taste.recommender.RecommendedItem;
import org.apache.mahout.math.VarLongWritable;
import org.apache.mahout.math.Vector;
import org.apache.mahout.math.VectorWritable;
import org.apache.mahout.math.map.OpenIntLongHashMap;public class AggregateAndRecommendReducer extends Reducer<VarLongWritable, Vecto
这篇关于向MapReduce转换:形成推荐的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!