User-based: Who is similar to the boy, and what do they like?
Item-based: What is similar to what the boy likes?
The algorithm
The difference between User-based and Item-based :
Slope-one recommender
It estimates preferences for new items based on average difference in the preference value (diffs) between a new item and the other items the user prefers.
Formula
In this case, the average difference in ratings between item B and A is (2+(-1))/2=0.5. Hence, on average, item A is rated above item B by 0.5. Similarly, the average difference between item C and A is 3. Hence, if we attempt to predict the rating of Lucy for item A using her rating for item B, we get 2+0.5 = 2.5. Similarly, if we try to predict her rating for item A using her rating of item C, we get 5+3=8.
If a user rated several items, the predictions are simply combined using a weighted average where a good choice for the weight is the number of users having rated both items. In the above example, we would predict the following rating for Lucy on item A:
Hence, given n items, to implement Slope One, all that is needed is to compute and store the average differences and the number of common ratings for each of the n2 pairs of items.
preprocessing phase, in which all item-item preference value differences are computed:
recommendation algorithm looks like this:
SampleCode
DiffStorage diffStorage = new MemoryDiffStorage(model, Weighting.UNWEIGHTED, Long.MAX_VALUE)); return new SlopeOneRecommender(model,Weighting.UNWEIGHTED,Weighting.UNWEIGHTED, diffStorage); //or return new SlopeOneRecommender(model)
Slope-one does have its price: memory consumption.It may become necessary to store diffs elsewhere.
AbstractJDBCDataModel model = new MySQLJDBCDataModel(); DiffStorage diffStorage = new MySQLJDBCDiffStorage(model); Recommender recommender = new SlopeOneRecommender(model, Weighting.WEIGHTED, Weighting.WEIGHTED, diffStorage);
References
http://en.wikipedia.org/wiki/Slope_One
相关推荐
1. **会话推荐(Session-based Recommendation)**: 文章讨论了一种特定的推荐系统——基于会话的推荐系统。这种系统与传统的推荐系统不同,它不依赖于用户的长期历史信息,而是基于匿名的会话数据来预测用户的动作...
基于项目的协同过滤推荐算法是推荐系统中的一种关键技术,它主要用于个性化推荐,即在活互动过程中为用户提供信息、产品或服务的推荐。随着网络信息的剧增以及访问网站的用户数量的增多,推荐系统面临着诸多挑战,...
其中,基于物品(Item-Based)的系统过滤算法是推荐系统中一种广泛应用且效果显著的技术。本文将深入探讨这种算法的原理、实现方法以及在在线判断推荐(online-judge-recommendation)场景中的应用。 一、基于物品...
将名为train-item-views.csv和yoochoose-clicks.dat的两个特定文件放入文件夹datasets/ 更改为datasets折叠并运行preprocess.py脚本以预处理数据集。 应该在datasets/下生成两个以数据集命名的目录。 python ...
此外,协同过滤又可分为用户协同过滤(User-based Collaborative Filtering)和项目协同过滤(Item-based Collaborative Filtering),前者侧重于相似用户群体,而后者侧重于相似商品之间的关系。 现代推荐系统还...
Tra- ditional tensor-based models in context-aware recommendation scenario only consider user-item-context interactions. In this paper, we argue that rating can’t be totally explained by the ...
3. 基于项的推荐(Item-to-item recommendation):作为解决上述问题的常见实践,推荐系统会推荐与用户当前正在浏览的项目相似的其他项目。尽管这种方法可以部分解决短期会话数据推荐的问题,但其推荐的准确性有限,...
a) 2004ACMtois Item-based top-N recommendation algorithms.pdf (协同过滤) b) 2007PRE Bipartite network projection and personal recommendation.pdf (网络结构) 4. 动手能力(实践算法-进阶篇) a) 2010PNAS-...
使用 Kaggle 上的电影数据集,利用 Python 和相关库,构建了同时基于内容和受欢迎程度的推荐引擎和基于协同过滤(Model-Based Recommendation、memory-based Recommendation 、Item-Based Recommend…协同过滤算法...
a) 2004ACMtois Item-based top-N recommendation algorithms(协同过滤) b) 2007PRE Bipartite network projection and personal recommendation(网络结构) 4. 动手能力(实践算法-进阶篇) a) 2010PNAS-Solving the ...
"personal_recommendation-master.zip" 文件包含了推荐系统相关的算法代码和实例,非常适合初级学习者入门。 在这个压缩包中,你可能找到以下几个方面的内容: 1. **协同过滤算法**:这是推荐系统中最常见的方法之...
在"sequence-based-recommendations-master"这个压缩包中,我们可以期待找到以下关键知识点: 1. **序列建模**:代码可能包含对用户行为序列的建模方法,如使用马尔科夫链、RNN(循环神经网络)、GRU(门控循环单元...
除了上述主要类型之外,还有基于知识的推荐系统(Knowledge-Based Recommendation),通常依赖于领域知识来生成推荐,以及上下文感知推荐系统(Context-Aware Recommendation),它可以利用用户当前的环境、上下文...
reduction and the curse of dimensionality, delving into classification use cases with the random forest and Naïve Bayes classifier and item and user-based recommendation. You will then work with ...
包括基于内容的推荐(Content-based Recommendation)、基于关联规则的推荐(Association-based Recommendation)、基于用户的协同过滤(User-based Collaborative Filtering)和基于项目的协同过滤(Item-based ...
在Java中,可以使用Apache Mahout或Spark MLlib等机器学习库来实现协同过滤算法,如User-Based和Item-Based的协同过滤。 项目中的"movie-recommendation-prog-main"可能是一个Java主程序入口,它将调用数据处理模块...
- **基于物品的协同过滤(Item-Based Collaborative Filtering)**:通过计算物品间的相似度,找到用户曾经喜欢的物品的类似物品,然后推荐给用户。 - **应用场景**:广泛应用于电商平台的商品推荐,如“看过这个...
主要包括基于用户的协同过滤(User-Based)和基于物品的协同过滤(Item-Based)两种方法。 - **优点**:能有效利用用户群体中的相似性进行推荐。 - **缺点**:同样面临数据稀疏性和冷启动问题。 3. **人口统计学...