Machine learning 为什么Apache Mahout';s Recommender.recommend()函数的速度慢吗?

Machine learning 为什么Apache Mahout';s Recommender.recommend()函数的速度慢吗?,machine-learning,mahout,recommendation-engine,mahout-recommender,Machine Learning,Mahout,Recommendation Engine,Mahout Recommender,我正在使用ApacheMahout基于项目的推荐器,该推荐器在400个项目和500万用户的数据集上具有项目相似性。我正在使用TanimotoEconficientSimilarity和GenricItemBasedRecommender 但是,当我调用函数recommender.recommend时,对于每个用户,大约需要1500毫秒才能生成5个项目的推荐。我也尝试过在相似性和推荐中进行缓存,但没有任何帮助。ApacheMahout 0.8是否存在性能问题,导致生成推荐需要很长时间 请建议优化的

我正在使用ApacheMahout基于项目的推荐器,该推荐器在400个项目和500万用户的数据集上具有项目相似性。我正在使用
TanimotoEconficientSimilarity
GenricItemBasedRecommender

但是,当我调用函数recommender.recommend时,对于每个用户,大约需要1500毫秒才能生成5个项目的推荐。我也尝试过在相似性和推荐中进行缓存,但没有任何帮助。ApacheMahout 0.8是否存在性能问题,导致生成推荐需要很长时间

请建议优化的方法


谢谢。

您可以尝试使用
CandidateItemsStrategy
最相似的ScanditeItemsStrategy
。 例如:

您可以尝试使用参数对候选项进行采样。这些类似于在
UserBasedSimilarity
中使用相邻用户

如果它仍然很慢,你应该考虑预先计算这些项之间的所有相似性,并将它们用于主存。如果没有足够的主内存,您甚至可以尝试通过数据库调用预计算的相似性

CandidateItemsStrategy candidateStrategy = new SamplingCandidateItemsStrategy(...);
MostSimilarItemsCandidateItemsStrategy mostSimilarStrategy = new SamplingCandidateItemsStrategy(...);

Recommender recommender = new GenericItemRecommender(model, similarity, candidateStrategy, mostSimilarStrategy);