如何使用 Mahout 获得 k 个相似产品?
我有一个产品,比如说一本书。现在我想检索 k 个与该产品相似的产品。我怎样才能用 Mahout 做到这一点?
产品存储在 MySQL 数据库中,因此我将使用 JDBCDataModel。 为了计算相似性,我更喜欢 LogLikelihoodTest。
但我应该选择哪个推荐人呢?看来所有的推荐人都是设计好的
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?
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将在这里猜测这个问题。您拥有用户-项目数据,其中用户是真实的人,项目是书籍。您正在使用 LogLikelihoodSimilarity 作为某些推荐器的基础,无论是基于用户的还是基于项目的。
如果您只想要最相似的商品,则不需要推荐人。只需使用
LogLikelihoodSimilarity
(它是一个ItemSimilarity
)来计算与所有其他项目的相似度并选取最相似的项目。事实上,看看TopItems
类,它甚至可以为您执行该逻辑。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.You don't need a recommender if you just want most similar items. Just use
LogLikelihoodSimilarity
, which is anItemSimilarity
, to compute similarity with all other items and take the most similar ones. In fact look at theTopItems
class which even does that logic for you.