recommending items to some user, denoted by u, as seen below

It would be terribly slow to examine every item. In reality, a neighborhood of most similar users is computed first, and only items known to those users are considered:

The basic flow to build a CF likes blow codes in mahout:
DataModel model = new FileDataModel(new File("intro.csv"));
UserSimilarity similarity = new PearsonCorrelationSimilarity(model);
UserNeighborhood neighborhood = new NearestNUserNeighborhood(2, similarity, model);
Recommender recommender = new GenericUserBasedRecommender( model, neighborhood, similarity);
//retrive recommend result for user 1
List<RecommendedItem> recommendations = recommender.recommend(1, 1);
The content of intro.csv file is formatted by fields UserID ItemID PreferenceValue
4,103,3.0 4,104,4.5 4,106,4.0 5,101,4.0 5,102,3.0 5,103,2.0 5,104,4.0 5,105,3.5
Exploring user neighborhoods
- Fixed-size neighborhoods
UserNeighborhood neighborhood = new NearestNUserNeighborhood(100, similarity, model);

- Threshold-based neighborhood
UserNeighborhood neighborhood = new ThresholdUserNeighborhood(0.7, similarity, model);

本文介绍了一种基于用户的协同过滤推荐系统实现方法。通过使用Mahout库,文章详细展示了从数据准备到构建推荐系统的全过程,并探讨了不同用户邻域策略的选择。
656

被折叠的 条评论
为什么被折叠?



