如何使用Mahout获得k个类似产品? [英] How to get k similar products using Mahout?

查看:76
本文介绍了如何使用Mahout获得k个类似产品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个产品,比如说一本书.现在,我要检索与该产品相似的k个产品.我该如何通过Mahout做到这一点?

I have one product, let's say a book. Now I want to retrieve k products, that are similar to this product. How can I do this with Mahout?

产品存储在MySQL数据库中,因此我将使用JDBCDataModel. 为了计算相似度,我希望使用LogLikelihoodTest.

The products are stored in a MySQL database so I'd use the JDBCDataModel. For computing the similarities I'd prefer the LogLikelihoodTest.

但是我应该选择哪个推荐者?似乎所有推荐器都是经过设计的

But which recommender should I choose? It seems that all recommenders are designed

推荐答案

我将在这里猜测这个问题.您拥有用户项目数据,其中用户是真实的人,项目是书籍.您正在使用LogLikelihoodSimilarity作为某些基于用户或基于项目的推荐器的基础.

I'm going to guess at the question here. You have user-item data, where users are real people and items are books. You are using LogLikelihoodSimilarity as the basis for some recommender, either user-based or item-based.

如果您只想要大多数相似的商品,则不需要推荐者.只需使用LogLikelihoodSimilarity(它是ItemSimilarity)来计算与所有其他项目的相似度并采用最相似的项目.实际上,请查看TopItems类,它甚至可以为您执行该逻辑.

You don't need a recommender if you just want most similar items. Just use LogLikelihoodSimilarity, which is an ItemSimilarity, to compute similarity with all other items and take the most similar ones. In fact look at the TopItems class which even does that logic for you.

这篇关于如何使用Mahout获得k个类似产品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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