谁有基于用户的推荐系统或者协同过滤的算法和代码分析
1个回答
展开全部
个大数据的大神给个 基于用户的推荐系统或者协同过滤的算法和代码分析啊
我有部分代码但是不知道怎么在Eclipse上实现 求解答啊
1.public class AggregateAndRecommendReducer extends Reducer<VarLongWritable,VectorWritable,VarLongWritable,RecommendedItemsWritable>{
...
public viod reduce (VarLongWritable key,Iterable<VectorWritable>values,Context context)throws IOException,InterruptedException{
Vector recommendationVector=null;
for(VectorWritable vectorWritable:values){
recommendationVector=recommendationVector==null?
vectorWritable.get();
recommendationVector.plus(bectorWritable.get());
}
Queue<RecommendedItem> topItems=new PriorityQueue<RecommendedItem>(recommendationsPerUser+1,Collections.reverseOrder(ByValueRecommendedItemComparator.getInstance()));
Iterator<Vector.Element> recommendationVectorIterator=recommendationVector.iterateNonZero();
while(recommendationVectorIterator.hasNext()){
vector.Element element=recommendationVectorIterator.next();
int index=element.index();
我有部分代码但是不知道怎么在Eclipse上实现 求解答啊
1.public class AggregateAndRecommendReducer extends Reducer<VarLongWritable,VectorWritable,VarLongWritable,RecommendedItemsWritable>{
...
public viod reduce (VarLongWritable key,Iterable<VectorWritable>values,Context context)throws IOException,InterruptedException{
Vector recommendationVector=null;
for(VectorWritable vectorWritable:values){
recommendationVector=recommendationVector==null?
vectorWritable.get();
recommendationVector.plus(bectorWritable.get());
}
Queue<RecommendedItem> topItems=new PriorityQueue<RecommendedItem>(recommendationsPerUser+1,Collections.reverseOrder(ByValueRecommendedItemComparator.getInstance()));
Iterator<Vector.Element> recommendationVectorIterator=recommendationVector.iterateNonZero();
while(recommendationVectorIterator.hasNext()){
vector.Element element=recommendationVectorIterator.next();
int index=element.index();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询