推荐系统:Slope One 算法

Slope One 算法是由 Daniel Lemire 教授在 2005 年提出的一个 Item-Based 推荐算法。 
Slope One 算法试图同时满足这样的的 5 个目标: 
 
   1. 易于实现和维护:普通工程师可以轻松解释所有的聚合数据,并且算法易于实现和测试。 
   2. 运行时可更新的:新增一个评分项,应该对预测结果即时产生影响。 
   3. 高效率的查询响应:快速的执行查询,可能需要付出更多的空间占用作为代价。 
   4. 对初次访问者要求少:对于一个评分项目很少的用户,也应该可以获得有效的推荐。 
   5. 合理的准确性:与最准确的方法相比,此方法应该是有竞争力的,准确性方面的微小增长不能以简单性和扩展性的大量牺牲为代价。 
 
使用这个图可以简明扼要的说明一下 Slope One 算法。 
 
   1. User A 给 Item I 打分为 1;给 Item J 打分为 1.5。 
   2. Uesr B 给 Item I 打分为 2。 
   3. 问题是:User B 给 Item J 打分为多少? 
   4. 使用 Slope One 算法,答案是:2.5,2+(1.5-1)=2.5。 
 
是不是非常简单?!Slope One 算法就是这么简单,而且它居然还相当有效!详细的试验分析可以看这里“Slope One Predictors for Online Rating-Based Collaborative Filtering”。 
 
喜欢 Python 的朋友可以看这篇 Blog,“tutorial about how to implement Slope One in Python”, 非常详细的介绍了 Slope One 算法在 Python 下的实现步骤。当然了,这只是一个非常简单的实现,你可以使用 MovieLens 或者 EachMovie 的数据集进行一些简单地试验。但如果真正要把它投入到商业环境,还有许多其他的工作必须做好。 

 

 

python实现

 

 

During a lunchtime conversation the other day, a coworker mentioned that he was hacking in his spare time on an entry for the Netflix Prize. This got me to thinking about collaborative filtering: why had I never seen a good description of how to do it? I suspect that people who might ordinarily have a casual interest in the subject hear that there are some statistics involved, whereupon they immediately freeze in the mathematical headlights, and turn the conversation to something else, anything else. In early 2005, a researcher named Daniel Lemire published, with Anna Maclachlan, a paper with the jazzy title of “Slope One Predictors for Online Rating-Based Collaborative Filtering“. This is an important paper, because it presents a family of really simplecollaborative filtering schemes. I mean really simple: there are no statistics involved, just a little bit of linear algebra. Unfortunately, because the Lemire/Maclachlan paper is aimed at an academic audience, it’s not trivial to tell by merely reading it how simple the technique it presents is, so what follows is my attempt to translate its ideas into my native language of Attention Deficit Programmerese. To make things more concrete, I’m going to present an implementation in less than 40 lines of Python (and I’ll try to explain any obscure bits of Python as I go). Cool, huh? Regardless of the underlying implementation, collaborative filters tend to try to solve the same broad problem using much the same

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值