我正在尝试使用mahout中的基于项目的推荐。它包含250万个用户,项目交互,没有偏好值。大约有100个项目,100k users.It需要大约10秒才能推荐。而对于相同的数据,当我使用基于用户的推荐时,它只需要不到一秒钟的时间。
ItemSimilarity sim = new TanimotoCoefficientSimilarity(dm);
CandidateItemsStrategy cis = new SamplingCandidateItemsStrategy(10,10,10,dm.getNumUsers(),dm.getNumItems());
MostSimilarItemsCandidateItemsStrategy mis = new SamplingCandidateItemsStrategy(10,10,10,dm.getNumUsers(),dm.getNumItems());
Recommender ur = new GenericBooleanPrefItemBasedRecommender(dm,sim,cis,mis);我读到了@Sean的一个答案,他建议对SamplingCandidateItemsStrategy使用上面的参数。但我不太确定它到底做了什么。
编辑:2.5M为用户-项目关联总数,有10万个用户,项目总数为100个。
发布于 2014-02-07 16:48:14
在众多原因中,选择基于项目的推荐器的主要原因是:if the number of items is relatively low compared to the number of users, the performance advantage could be significant。这也是反过来的。If the number of users is relatively low compared to the number of items, choosing user-based recommendation will result in performance advantage。
从你的问题中,我真的不知道你的数据集中有多少个项目,以及用户的数量。当你提到250万,然后是10万?在任何情况下,如果基于用户的推荐对你来说更快,你应该选择这种方法。
除非,如果您的项-项相似度更固定(不会发生根本性或频繁的变化),则它们是更好的预计算候选者。您可以进行预计算,并使用预计算出的项目之间的相似性。
此外,由于您没有首选项值,并且如果您希望使用基于项目的相似度,您可以考虑根据项目的某些特征使用一些纯粹的项目-项目相似度来丰富相似度函数。(这只是一个想法)。
https://stackoverflow.com/questions/21596315
复制相似问题