Apache Mahout没有给出任何建议 [英] Apache Mahout not giving any recommendation

查看:195
本文介绍了Apache Mahout没有给出任何建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试使用mahout进行推荐,却一无所获.

I am trying to use mahout for the recommendation but getting none.

我的数据集:

0,102,5.0
1,101,5.0
1,102,5.0

代码:

      DataModel datamodel = new FileDataModel(new File("dataset.csv"));
        // Creating UserSimilarity object.
        UserSimilarity usersimilarity = new PearsonCorrelationSimilarity(datamodel);

        // Creating UserNeighbourHHood object.
        UserNeighborhood userneighborhood = new ThresholdUserNeighborhood(0.1, usersimilarity, datamodel);

        // Create UserRecomender
        UserBasedRecommender recommender = new GenericUserBasedRecommender(datamodel, userneighborhood, usersimilarity);

        List<RecommendedItem> recommendations = recommender.recommend(0, 1);

        for (RecommendedItem recommendation : recommendations) {
            System.out.println(recommendation);
        }

我正在使用Mahout版本:0.13.0

理想情况下,应该建议item_id = 101' to 'user_id = 0' as user = 0 and user = 1 have item 102 common show it should recommend item_id = 101 to user_id = 0`

Ideally, it should recommend item_id = 101' to 'user_id = 0' asuser = 0anduser = 1have item 102 common show it should recommenditem_id = 101touser_id = 0`

日志:

18:08:11.669 [main] INFO org.apache.mahout.cf.taste.impl.model.file.FileDataModel - Creating FileDataModel for file dataset.csv
18:08:11.700 [main] INFO org.apache.mahout.cf.taste.impl.model.file.FileDataModel - Reading file info...
18:08:11.702 [main] INFO org.apache.mahout.cf.taste.impl.model.file.FileDataModel - Read lines: 3
18:08:11.722 [main] INFO org.apache.mahout.cf.taste.impl.model.GenericDataModel - Processed 2 users
18:08:11.738 [main] DEBUG org.apache.mahout.cf.taste.impl.recommender.GenericUserBasedRecommender - Recommending items for user ID '0'

推荐答案

不推荐使用Mahout中的Hadoop Mapreduce代码.新的推荐程序代码以@rawkintrevo的示例开头.如果您是Scala程序员,请遵循它们.

The Hadoop Mapreduce code in Mahout is being deprecated. The new recommender code starts with @rawkintrevo 's examples. If you are a Scala programmer follow them.

大多数工程师都希望没有修改的工作系统,Mahout算法封装在基于Apache PredictionIO的Universal Recommender中.它具有一个接受事件的服务器(例如您的示例中的事件),内部事件存储和一个用于查询结果的查询服务器.对旧的Mapreduce代码进行了许多改进,包括使用实时用户行为提出建议.不管是新的Mahout还是旧的旧服务器都无法输入和查询,Universal Recommender都具有REST端点.

Most Engineers would like a system that works with no modification, The Mahout algorithm is encapsulated in The Universal Recommender built on top of Apache PredictionIO. It has a server to accept events, like the ones in your example, it has internal event storage, and a query server for results. There are numerous improvements over the old Mapreduce code, including using real-time user behavior to make recommendations. Neither the new Mahout nor the old included servers for input and query, the Universal Recommender has REST endpoints for both.

鉴于您所使用的代码将被弃用,我强烈建议您深入研究Mahout代码(@rawkintrevo的示例)或查看通用推荐器,它是一个完整的端到端系统.

Given that the code you are using will be deprecated I strongly suggest that you dive into Mahout code (@rawkintrevo's example) or look at The Universal Recommender, which is an entire end-to-end system.

  • 在单机"设置中安装PredictionIO,请在此处,或者使用我们预包装的AWS来实现真正的快捷设置AMI 此处它包括PIO和预先安装的Universal Recommender.
  • 此处
  • 添加UR模板
  • 用于将事件发送到推荐程序的Java SDK,此处
  • Install PredictionIO with a "single machine" setup here or to really shortcut setup use our prepackaged AWS AMI here It includes PIO and The Universal Recommender pre-installed.
  • Add the UR Template here
  • A Java SDK for sending events to the recommender here

完成此设置后,您将处理config,REST或Java SDK和PIO CLI.无需Scala编码.

Once you have this setup you deal with config, REST or Java SDK and the PIO CLI. No Scala coding required.

这篇关于Apache Mahout没有给出任何建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆