象夫推荐者
Apache Mahout 推荐文档 提到以下内容:
// Construct the list of pre-computed correlations
Collection <GenericItemSimilarity.ItemItemSimilarity> correlations = ...;
我不确定实际情况如何施工是在上面的线路中完成的。有人可以举个例子吗?
ItemSimilarity itemSimilarity = new GenericItemSimilarity(correlations);
The Apache Mahout Recommender Documentation mentions the following:
// Construct the list of pre-computed correlations
Collection <GenericItemSimilarity.ItemItemSimilarity> correlations = ...;
I'm not sure how the actual construction is done in the above line. Can someone provide an example?
ItemSimilarity itemSimilarity = new GenericItemSimilarity(correlations);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此示例指的是您已经通过 Hadoop 作业计算出相似性并将其存储在文件系统或数据库中的情况。正如构造函数文档所述:
一个“通用”{@link ItemSimilarity},它采用预先计算的项目相似性的静态列表,并仅以此为基础进行响应。这些值可能已由另一个进程预先离线计算,存储在文件中,然后读取并输入到此类的实例中。
如果您有数千万或更少的推荐,您可以简单地计算飞行并使用其他
GenericItemSimilarity
构造函数 -GenericItemSimilarity(ItemSimilarity otherSimilarity, DataModel dataModel)
例如:
This example refers to the case where you have the similarities already computed, by the Hadoop job for example, and stored on the filesystem or database . As the constructor documentation reads:
A "generic" {@link ItemSimilarity} which takes a static list of precomputed item similarities and bases its responses on that alone. The values may have been precomputed offline by another process, stored in a file, and then read and fed into an instance of this class.
If you have tens of millions of recommendations or less, you can simply compute similarities on the fly and use the other
GenericItemSimilarity
constructor -GenericItemSimilarity(ItemSimilarity otherSimilarity, DataModel dataModel)
For example:
这里没有什么魔力,它只是建议您创建一堆 ItemItemSimilarity 对象,每个对象对应您所了解的每个项目之间的相似性。
您可以采用这种方式或任何您想要的其他方式。
There's no magic here, it's just suggesting you create a bunch of those ItemItemSimilarity objects, one for each item-item similarity that you know about.
You can make it this way or any other way you want.